I created a hashmap in my SERVLET as follows:
int productId = Integer.parseInt(request.getParameter("productId"));
HashMap cartList = new HashMap();
Cart item = new Cart(productId, productName, price, quantity);
cartList.put(productId, item);
But I have get the following error:
org.apache.jasper.JasperException: javax.el.PropertyNotFoundException: The class 'java.util.HashMap$Entry' does not have the property 'productId'.
What does it mean? How can i resolve my error?
EDIT: HERE is my JSP
<c:forEach var="cart" items="${cartList}">
${cart.productId}
${cart.productName}
<form method="POST" action="ShoppingCartUpdate">
<input type="submit" value ="Update" class="loginButton" name="Update">
</form>
<form method="POST" action=""ShoppingCartRemove">
<input type="submit" value ="Remove" class="loginButton" name="Delete">
</form>
</c:forEach>