【发布时间】:2018-01-29 02:38:15
【问题描述】:
我正在使用 thymeleaf 来显示我的网站。它是一个列出输入的表单。
<tr th:each="entry, stat : ${formWrapper.propertiesList}">
<td> <label class="propertiesLabel" th:text="${entry.key}"/></label></td>
<td> <input type="text" th:id="${entry.key}" th:field="*{propertiesList[__${stat.index}__].value}"></input></td>
</tr>
在我的模型中,我的表单包含这些对象。
public form(String key, String value){
super();
this.key = key;
this.value = value;
}
//getter amd setter methods
我还有一个包装器来包装表单。
public ArrayList<Form> getPropertiesList(){
return propertiesList;
}
public void setPropertiesList(ArrayList<Form> properties){
this.propertiesList = properties;
}
有人有任何方法来验证输入值列表吗?通过javascript(前端)或Java(后端)对我有好处。
【问题讨论】:
标签: javascript java spring validation thymeleaf