2
在我的控制器中,我添加了一个ArrayList到属性名为“users”的模型中。形式为spring-mvc binding arraylist
现在我环顾四周,这是我发现的(包括在此问题)的方法:
<form:form action="../user/edit" method="post" modelAttribute="users">
<table>
<c:forEach var="user" items="${users}" varStatus="counter">
<tr>
<td>
<form:input path="users[${counter.index}].age"/>
</td>
<td><button type="submit" name="updateId" id="Update" value="${user.id}">Update</button></td>
</tr>
</c:forEach>
</table>
</form:form>
但是当我加载JSP页面中我得到:
.springframework.beans。 NotReadablePropertyException: Bean的无效属性'projects [0]' class [java.util.ArrayList]:Bean property'users [0]'is not readable or has invalid invalid get method:Does the retu该吸气剂的类型是否与匹配器的参数类型 匹配?
因此设想这不是要走的路,但在那种情况下,我该如何绑定一个数组列表,以便我可以编辑值?
您可以添加的代码数据发送的控制器方法? – Javi 2010-05-07 15:49:39