Controller
@RequestMapping(value = "/admin/company/companyRegistration", method = RequestMethod.GET)
public String companyList(Model model) {
log.debug("a1 :"+companyService.getCompanySelectNameList(companyVO));
model.addAttribute("companySelectNameList", companyService.getCompanySelectNameList(companyVO));
return "/admin/company/companyRegistrationList";
}
안나왔던 이유
String companyList 메소드에 url 경로가 "/admin/company/companyRegistration"
가 있는데 이거와 같은 String companySelectList 가 똑같은 경로가 지정되어 있었다.
그래서 위의 컨트롤러를 안타고 다른 곳을 타서 목록이 뿌려지지 않은 것.
<label for="selectType">
<select id="selectType" class="custom-select custom-select-sm">
<option value="select" selected="selected">선택</option>
<c:forEach var="list" items="${companySelectNameList}">
<option value="${list.idkey}">${list.companyName}</option>
</c:forEach>
</select>
</label>
select 박스에서는 for문을 직접 쓰는 대신에 jstl 을 사용했다.