Java 百里香叶<;选择>;标记生成选项(编号)
我在HTML中有一个Java 百里香叶<;选择>;标记生成选项(编号),java,html,spring,drop-down-menu,thymeleaf,Java,Html,Spring,Drop Down Menu,Thymeleaf,我在HTML中有一个标记,需要生成从1到53的选项,然后选择一个我用doPost方法发送的选项 我尝试使用我在这里找到的解决方案: , 另外,一旦生成了th:标记,我应该使用它从列表中选择什么?您没有关闭th:each属性的花括号} 应该是 更新 <select name="week_scroll"> <option>Select</option> <option th:each="n : ${#numbers.sequence(1,53
标记,需要生成从1到53的选项,然后选择一个我用doPost
方法发送的选项
我尝试使用我在这里找到的解决方案:
,
另外,一旦生成了th:标记,我应该使用它从列表中选择什么?您没有关闭th:each属性的花括号
}
应该是
更新
<select name="week_scroll">
<option>Select</option>
<option th:each="n : ${#numbers.sequence(1,53)}" th:value="${n}" th:text="${n}"/>
</select>
挑选
您使用的是什么版本的thymeleaf?我相信这些实用类方法需要2.1.3才能工作。
org.thymeleaf.exceptions.TemplateProcessingException:
Could not parse as each: "n : ${#numbers.sequence(1,53)"
<select name="week_scroll">
<option>Select</option>
<option th:each="n : ${#numbers.sequence(1,53)}" th:value="${n}" th:text="${n}"/>
</select>