Question: Use URL rewriting instead of hidden fields Start NetBeans and open the project named ch07_ex3_cart project thats on the Canvas page. You must unzip the
Use URL rewriting instead of hidden fields
Start NetBeans and open the project named ch07_ex3_cart project thats on the Canvas page. You must unzip the file.
Open the source code for CartServlet class. Note that this servlet only supports the HTTP POST method.
Open the cart.jsp file. Then convert the Remove button to a Remove link that uses URL rewriting.
Run the application and test the Remove link. This link should not work since it uses the HTTP GET method.
Modify the CartServlet class so it includes a doGet method that includes a single statement that call the doPost method. That way, the CartServlet uses the same code to handle the HTTP POST and GET methods.
Run the application again and test the Remove link. Now this link should work correctly and it should display the parameter names and values in the browsers URL..
Test the Update button too. Since this button uses the HTTP POST method, it should not display the parameter names and values in the browsers URL.
Files are here: https://drive.google.com/file/d/0B5HjVVkWJYBIc1FpUXY0Z2E1Vlk/view?usp=sharing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
