thymeleaf循环时要用标签裹住循环体,如:
<div th:each="user:${list}">name
<h2 th:text="${user.name}"></h2>
<h2 th:text="${user.age}"></h2>
<h2 th:text="${user.password}"></h2>
</div>
否则循环报错
报错内容:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Sep 17 11:57:37 CST 2018
There was an unexpected error (type=Internal Server Error, status=500).
An error happened during template parsing (template: "class path resource [templates/index.html]")