Can you use the spring:bind tag inside jstl forEach? I don't think you can because of the nesting limitation? Then how does one bind objects in a collection? I've been using RequestUtils to pull the values out of the request, but what I hassle for anymore than a few items. Is there a better way? Is this what the BindUtil is for?
fyi
I have the following jsp which displays a table from the db with input fields. I want to submit this to my SimpleFormController. The controller's commandName is "statusCodes" and the commandClass is "java.util.Collection." I get the "put errors in model" exception when I put the bind tags in.
Thanks,Code:<c:forEach var="row" items="${statusCodes}" varStatus="status"> <tr> <td> <input type="text" name="tableAndColumn[<c:out value="${status.index}"/>]" size="20" value="<c:out value="${row.comp_id.tableAndColumn}"/>"> </td> <td> <input type="text" name="value[<c:out value="${status.index}"/>]" size="7" value="<c:out value="${row.comp_id.value}"/>"> </td> <td> <input type="text" name="meaning[<c:out value="${status.index}"/>]" size="20" value="<c:out value="${row.meaning}"/>"> </td> </tr> </c:forEach>


Reply With Quote