Question: Exercise 5 - 2 Create a new servlet In this exercise, you ll modify the HTML document for the Email List applica - tion, and

Exercise 5-2 Create a new servlet In this exercise, youll modify the HTML document for the Email List applica- tion, and youll create a new servlet that responds to the HTML document. This is comparable to what you did for exercise 5-1, but the details are repeated here. 1.2. 3. 4.5. 6.7.8.9. Open the ch05_ex2_email project thats in the ex_starts directory. Add a servlet named TestServlet to the murach.email package and map that servlet to the /test URL. Modify the code for the servlet so it implements the doPost method and the doGet method, but not the service method. Modify the doGet method so it displays a message that says TestServlet Get. Modify the doPost method so it displays a message that says TestServlet Post. Run the project and enter the /test URL into the browser to run the test servlet. This should show that the test servlet works for the HTTP GET method. Open the index.jsp file and modify it so it calls the /test URL instead of the /emailList URL. Run the project and click the Join Now button to run the test servlet. This should show that the test servlet works for the HTTP POST method. If the project uses the web.xml file to map the servlet, delete the mapping from the web.xml file and use the @WebServlet annotation to map the servlet instead. Run the project and test the servlet to make sure that the new mapping works

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!