How thymeleaf through the data

First, xmlns in the html start tag: th introduction thymeleaf

 1 <html xmlns:th="http://www.thymeleaf.org">  

Then use each loop to traverse

1  <tbody>
2                     <tr th:each="user : ${users}">  
3                         <td th:text="${user.name}"></td>
4                         <td th:text="${user.email}"></td>
5                         <td><a th:href="@{/edit/{id}(id=${user.id})}">修改</a></td>
6                         <td><a th:href="@{/delete/{id}(id=${user.id})}">删除</a></td>
7                     </tr>
8                 </tbody>

 

Guess you like

Origin www.cnblogs.com/hzyhx/p/11100395.html