타임리프 if else if else 조건식, 3항 연산자 사용법
<h2 th:text="${potentially_complex_expression} ? 'Hello' : 'Something else'">/h2>
<div th:switch="${user.role}">
<p th:case="'admin'">User is an administrator</p>
<p th:case="#{roles.manager}">User is a manager</p>
<p th:case="*">User is some other thing</p>
</div>
<div th:with="condition=${potentially_complex_expression}" th:remove="tag">
<h2 th:if="${condition}">Hello!</h2>
<span th:unless="${condition}" class="xxx">Something else</span>
</div>
'프로그래밍 > Spring & MyBatis' 카테고리의 다른 글
[Spring boot] Spring boot - nginx + tomcat 연동시 리얼 아이피 설정 방법 (1) | 2019.01.18 |
---|---|
[Spring] Spring Web Application Architecture (0) | 2018.12.19 |
[Spring Boot] 외장 톰캣 사용 (WAR 배포) (0) | 2018.12.11 |
[Spring Framework] Spring MVC (0) | 2018.12.10 |
[Spring Framework] @Transactional 트랜젝션 관리 (0) | 2018.12.10 |