I have a List<Products>
which contains data of my products table. On a servlet I am getting this List<Products>
. I am passing this list to JSP by following code:
List<Products>Products=new SessionBeanClass().DisplayProducts(arr);
request.setAttribute("Products",Products);
request.getRequestDispatcher("sample2.jsp").forward(request, response);
And I am displaying data of LIST on JSP by following code:
<c:forEach items="${requestScope['Products']}" var="emp" >
<table>
<tr>
<td> ${emp.getPrice()} </td>
</tr>
</table>
</c:forEach>
But when I write like this
<c:forEach items="${requestScope['Products']}" var="emp" >
<table>
<tr>
<td> ${emp.Price()} </td>
</tr>
</table>
</c:forEach>
It shows me an error
javax.el.PropertyNotFoundException 'Price' not found
Why?