Collect and save submitted values of multiple dynamic HTML inputs back in servlet
Given this simplified model: public class Item { private Long id; private String foo; private String bar; // … } Here’s how you can do it provided ${items} is List<Item>: <c:forEach items=”${items}” var=”item”> <tr> <td> <input type=”hidden” name=”id” value=”${item.id}” /> <input name=”foo_${item.id}” value=”${fn:escapeXml(item.foo)}” /> </td> <td> <input name=”bar_${item.id}” value=”${fn:escapeXml(item.bar)}” /> </td> </tr> </c:forEach> (note the … Read more