I defined Orders which contains a Collection of OrdersDetail. Trying to update both Orders and related OrdersDetail in a single form:
I manage to show the form with correct values. But when I submit the form, before arriving onSubmit, "Data binding errors: 1" was shown in log and the system jumped back to the form.Code:<form name="ordersMaintainForm" method="post" action="<c:url value="/orders/viewOrders.htm"/>"> <spring:nestedPath path="orders"> <table width="90%" align="center"> <tr> <td>Orders Id</td> <td> <c:out value="${orders.ordersId}"/> <spring:bind path="ordersId"> <input type="hidden" name="ordersId" value="<c:out value="${orders.ordersId}"/>"/> </spring:bind> </td> </tr> <tr> <td>Status</td> <td> <spring:bind path="status"> <input type="text" name="status" value="<c:out value="${orders.status}"/>"/> </spring:bind> </td> </tr> <c:forEach var="od" items="${orders.ordersDetails}" varStatus="loopStatus"> <spring:bind path="ordersDetails[${loopStatus.index}].itemId"> <input type="text" name="<c:out value="${status.expression}"/>" value="<c:out value="${status.value}"/>"/> </spring:bind> </c:forEach> </table> </spring:nestedPath> </form>
If I tried commenting out the ordersDetails part, the form is submittable.
I've tried adding the <spring:hasBindErrors> and activating log4j.logger.org.springframework=DEBUG, myLog. Both show nothing.
How could I debug it?
and is it appropriate to try maintaining a 1-N relations in this way?


Reply With Quote