Dynamic list binding in Spring MVC | mattfleming.com


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <c:forEach items="${grid.blocks}" varStatus="gridRow">
  2. <spring:bind path="grid.blocks[${gridRow.index}].id">
  3. <c:out value="${status.value}"/>
  4. <input type="hidden"
  5. name="<c:out value="${status.expression}"/>"
  6. id="<c:out value="${status.expression}"/>"
  7. value="<c:out value="${status.value}"/>" />
  8. </spring:bind>
  9. <spring:bind path="grid.blocks[${gridRow.index}].description">
  10. <c:out value="${status.value}"/>
  11. <input type="hidden"
  12. name="<c:out value="${status.expression}"/>"
  13. id="<c:out value="${status.expression}"/>"
  14. value="<c:out value="${status.value}"/>" />
  15. </spring:bind>
  16. </c:forEach>

URL: http://mattfleming.com/node/134

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.