thymeleaf 的th:each 在html中遍历时增加逗号 th:inline=“text” 是thymeleaf 的内联表达式,表示将会解析并替换双大括号 ${…} 包裹的表达式内容 <td> <span th:each="t, typeStat : ${blog.types}" th:inline="text"> [[${t.name}]] [[${!typeStat.last ? ',' : ''}]] </span> </td>