반응형
[Spring] JSTL <c:if></c:if> 사용법
// Controller
@RequestMapping("/cif")
public String cif(Model model) {
model.addAttribute("name", "park");
return "/test.jsp";
}
// jsp
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
// 젤위에 추가
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<body>
<c:if test="${name eq 'park'}">
name이 park일 때만 보임
</c:if>
</body>
</html>
반응형
'Spring' 카테고리의 다른 글
[Spring] Interceptor 로그인 처리 (0) | 2022.06.08 |
---|---|
[Spring] 디버그 실행 시 SilentExitException()에 멈춤 (0) | 2022.06.08 |
[Spring] mybatis에서 selectKey (0) | 2022.04.12 |
[Spring] CamelListMap 사용법 (0) | 2022.04.05 |
[Spring] Ajax에서 배열보내서 Controller로 받기 (0) | 2022.04.01 |
댓글