thymeleaf
<tr th:each="u : ${users}">
<div th:text="${user.username}"></div>
<div th:text="*{user.username}"></div>
<table border="1" th:object="${user}">
<tr>
<td>用户名</td>
<td th:text="*{username}"></td>
</tr>
<tr>
<td>地址</td>
<td th:text="*{address}"></td>
</tr>
</table>
message = javaboy,message = 江南一点雨
<div th:text="#{message}"></div>
- 引用绝对 URL:
<script type="text/javascript" th:src="@{http://localhost:8080/hello.js}"></script>等价于<script type="text/javascript" src="http://localhost:8080/hello.js"></script>