There is a list of products on jsp , each has its own id . When you click the More button, the request from the item id should come to the servlet. But always zoachenie 1 comes.
<form method="get" action="get_all_proposes/get_propose_by_id"> <c:forEach var="propose" items="${requestScope.allProposes}"> <ul> <li>Model: <c:out value="${propose.model}"/></li> <li>Mark: <c:out value="${propose.mark}"/></li> <li>Sold: <c:out value="${propose.sold}"/></li> <input name="pId" type="number" value="${propose.id}"> <input type="submit" value="More"> <hr> </ul> </c:forEach> </form> On the server, this is taken as:
final int pId = Integer.valueOf(req.getParameter("pId")); Why always comes 1 ? How to fix it?