Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

The Functions of Language Problems with Language

Answered: 1 week ago

Question

3. Job rotation is used for all levels and types of employees.

Answered: 1 week ago