728x90
반응형
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 을 사용했다.
반응형
'개발자의 공부방 > 스프링' 카테고리의 다른 글
Spring] JSON을 내려 줄 때 불필요한 값(필드) 삭제하기. (0) | 2021.04.14 |
---|---|
스프링] 에러 : java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed; 해결법 feat. 스프링부트 (0) | 2020.03.27 |
Mybatis] 끄적끄적 (0) | 2020.03.20 |
스프링] gradle @Slf4j 설정 feat. test 에서 자동임포트 안뜰 때 (0) | 2020.03.18 |
스프링] 의존성 주입 방법 여러가지. (0) | 2020.03.17 |