【发布时间】:2021-12-09 16:57:42
【问题描述】:
我想使用 thymeleaf 遍历一个列表。我的代码如下所示:
<ol th:each="test: ${tests}">
<li th:text="${test.toString()}"></li>
</ol>
此时,tests Set 包含 2 个元素,它们有一个 toString() 表示,分别是 test1 和 test2
我的 html 输出如下所示:
1.test1
1.test2
我想知道为什么他们两个都有数字 1,而不是 1 和 2?
【问题讨论】:
标签: java html spring thymeleaf