Thymeleaf 模板中的迭代不起作用
Iteration in Thymeleaf templat isn't working
我正在尝试使用 Thymeleaf 从模板内的语言文件中迭代拆分字符串。但它不起作用。
模板示例:
<div class="row" th:with="SPlatform=#{platforms}">
<div class="input-field col s4" th:each="platform : ${#strings.arraySplit(SPlatform, ',')}">
<input type="checkbox" class="filled-in" th:id="platforms"> <label
th:for="platforms" th:text=""></label>
</div>
</div>
语言文件messages_en.properties
中#{platforms}
的值是
platforms=Platform1,Platform2,Platform3
但最后我得到了那个错误:
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Aug 31 16:44:33 GST 2015
There was an unexpected error (type=Internal Server Error, status=500).
Could not parse as expression: "" (platform-add)
问题可能是
th:text=""
在您的标签内。
Thymeleaf 需要一个表达式来显示一些文本。
我正在尝试使用 Thymeleaf 从模板内的语言文件中迭代拆分字符串。但它不起作用。
模板示例:
<div class="row" th:with="SPlatform=#{platforms}">
<div class="input-field col s4" th:each="platform : ${#strings.arraySplit(SPlatform, ',')}">
<input type="checkbox" class="filled-in" th:id="platforms"> <label
th:for="platforms" th:text=""></label>
</div>
</div>
语言文件messages_en.properties
中#{platforms}
的值是
platforms=Platform1,Platform2,Platform3
但最后我得到了那个错误:
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Aug 31 16:44:33 GST 2015
There was an unexpected error (type=Internal Server Error, status=500).
Could not parse as expression: "" (platform-add)
问题可能是
th:text=""
在您的标签内。
Thymeleaf 需要一个表达式来显示一些文本。