#{}
<span th:text="#{test.id}"></span><br>
<span th:text="#{test.name}"></span><br>
apllication.properties 안에 있는 데이터
test1.context=dev (key)
test2.context=localhost:8080(value)
<ul>
<li><a th:href="@{/hello}">basic url</a></li>
<li><a th:href="@{/hello(param1=${param1}, param2=${param2})}">hello query param</a></li>
<li><a th:href="@{/hello/{param1}/{param2}(param1=${param1}, param2=${param2})}">path variable</a></li>
<li><a th:href="@{/hello/{param1}(param1=${param1}, param2=${param2})}">path variable + query parameter</a>
</li>
</ul>
HTML
1.7. th:href
<ul>
<li><a th:href="@{/hello}">basic url</a></li>
<li><a th:href="@{/hello(param1=${param1}, param2=${param2})}">hello query param</a></li>
<li><a th:href="@{/hello/{param1}/{param2}(param1=${param1}, param2=${param2})}">path variable</a></li>
<li><a th:href="@{/hello/{param1}(param1=${param1}, param2=${param2})}">path variable + query parameter</a></li>
</ul>
1.8. th:if, th:unless (if문)
<span th:if="${foodMap.food1} == '치킨'">치킨이다!</span>
<span th:unless="${foodMap.food1} == '치킨'">치킨이 아니다 ㅠㅠ</span>
값 세팅
<h2>th:with 사용 (c:set과 같은 느낌)</h2>
<span th:with="food='바뀐음식'"></span><br><br>
dateTime 출력(형식지정)
<hr>
default : <span th:text="${localDateTime}"></span><br>
yyyy-MM-dd HH:mm:ss : <span th:text="${#temporals.format(localDateTime, 'yyyy-MM-dd HH:mm:ss')}"></span> <br>
yyyy-MM-dd/a hh:mm : <span th:text="${#temporals.format(localDateTime, 'yyyy-MM-dd/a hh:mm')}"></span><br>
<hr>
attribute 활용
- th:classappend : <input type="text" class="text" th:attrappend="class= ' large'" /><br>
- checked o : <input type="checkbox" name="active" th:checked="true" /><br>
- checked x : <input type="checkbox" name="active" th:checked="false" /><br>
<br><br>
<style type="text/css">span{color: red}</style>
th:classappend : <input type="text" class="text" th:attrappend="class= ' large'" placeholder="여기에 이름을 넣어주세요"/><br>