Answered step by step
Verified Expert Solution
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 Create a new servletIn 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 but the details are repeated here.Open the chexemail project thats in the exstarts 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 GetModify the doPost method so it displays a message that says TestServlet PostRun 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started