【发布时间】:2019-12-03 21:42:01
【问题描述】:
我尝试在 thymeleaf 3 中添加 required 当它是第一个元素时。我已经有了属性名。
<div th:each="role, iter : ${roles}" th:remove="tag">
<input type="checkbox" th:attr="name='roles[]'" th:attrappend="${iter.first ? 'required' : ''}" th:value="${role.id}" th:text="${role.name}">
</div>
我收到此错误
org.thymeleaf.exceptions.TemplateProcessingException:无法解析 作为分配序列:“${iter.first ? 'required'}”
【问题讨论】:
标签: thymeleaf