I have ProductServlet.java
where get from data base List<Map<String, Object>> paramsList
- full of product object with its parameters. Then I do the following: request.setAttribute("paramList", paramsList);
and get the list in prodView.jsp
for its parsing:
<form method="POST" action="editProduct">
...
<c:forEach var="map" items="${paramList}" >
<tr>
<td>Attributes</td>
<td><input type="text" name="attr" value="<c:out value="${map['attrName']}"/>" /></td>
</tr>
<tr>
<td>Values of attributes</td>
<td><input type="text" name="vals" value="<c:out value="${map['value']}"/>" /></td>
</tr>
</c:forEach>
...
It's suppose that a user modifies the paramList. So I'd like to get this modified list<Map<String, Object>>
(its elements) in EditProductServlet.java
(@WebServlet(urlPatterns = { "/editProduct" })
). But I don't know exactly how to do this. And when I try this I get nothing:
String t = (String) request.getParameter("attr");
Thank you for help!