Thymeleaf <select>标签生成选项(数字)

3
我在HTML中有一个

你使用的thymeleaf版本是哪个?我认为你需要使用2.1.3版本才能让这些实用程序类方法工作。 - ndrone
1个回答

8

你没有关闭th:each属性中的花括号}

正确的写法应该是

已更新

<select name="week_scroll">
    <option>Select</option>
    <option th:each="n : ${#numbers.sequence(1,53)}" th:value="${n}" th:text="${n}"/>
</select>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接