Trying to access an arraylist or a cart object from a jsp page
posted 7 years ago
Hi all I am trying to learn the shopping cart tutorial from Murach's servlets and jsp book. I am trying to integrate MQ series with that. In this project, some products are stored in a database and every time the user clicks on some product page, it should not make a database call. The database records are fetched in a Message Driven bean and stored as an arraylist or cart object. How do I call that arraylist or cart object from a jsp page?Please help me! Thanks in advance Vidya
Your page controller servlet (which I assume obtains the arraylist of information from a model class) will place the list into request scope via request.setAttribute(). Then in the JSP, you will ise the EL and JSTL to access the information.