Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use JSTL in the Cart application Download, unzip and open the ch09_ex2_cart project. https://drive.google.com/file/d/0B5HjVVkWJYBIMWlFTTAwMzlFRjA/view?usp=sharing Open the web.xml file. Note that the ProductServlet class is mapped

Use JSTL in the Cart application

Download, unzip and open the ch09_ex2_cart project. https://drive.google.com/file/d/0B5HjVVkWJYBIMWlFTTAwMzlFRjA/view?usp=sharing

Open the web.xml file. Note that the ProductServlet class is mapped to the /loadProducts URL and that this URL is set as the only welcome page. As a result, when this app starts, the browser issues an HTTP GET request for the ProductServlet class.

Open the ProductServlet.java file. Note how this servlet uses the doGet method to read an ArraryList of Product objects from the projects.txt file and store them as an attribute of the session object.

Make sure the JSTL library is available on this application.

Test the application to make sure it works correctly.

Open the index.jsp file and add the taglib directive that imports the core JSTL library. Then, add a forEach tag that loops through the ArrayList of Product objects and displays one row for each product. To do that, you can use EL to display the properties of each Product object. ) Be sure to delete any old code that you no longer need.)

Test the application to make sure that it works correctly.

To prevent against XSS attacks, add the out tag to any EL values that should be escaped before they are returned to the browser.

Test the application to make sure that it still works correctly.

Download Files: https://drive.google.com/file/d/0B5HjVVkWJYBIMWlFTTAwMzlFRjA/view?usp=sharing

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions