In the PHP when I click submit the server will get all the submit value via $_POST
So how can I do same like that with asp
<form name="submitForm" method="post" action="cart?action=update">
<c:forEach var="product" items="${products}">
<input type="text" name="${product.productID}" value="${product.quantity}" />
</c:forEach>
<input type="submit" value="Update" />
</form>
I want after submitting, I can get only one value in the servlet and the value consists multiple input value without give it a particular name.
I tried
System.out.println(request.getParameterValues("submitForm"));
But its null
Could anyone point me out ? Thanks
I believe,
${product.productID}is having different value in each record. Use the values from here to get the values in the server side. e.g. if${product.productID}results intoproductId1, productId2, prductId3...., retireve the values as:If you are unsure about the names to retrieve, you may get them all parameter names using
request.getParameterNames(). e.g. below:Hope this helps.