Question
Someone please help me to find these answers: Exercises: Form Data In this project, you will probably copy and rename your servlet a lot, since
Someone please help me to find these answers:
Exercises: Form Data In this project, you will probably copy and rename your servlet a lot, since later problems are similar to earlier problems. When you do this copying, always change the URL (i.e., the value inside @WebServlet). If you have two servlets with the same address, the server will totally ignore one.
1. Open the forms project. Run the ThreeParams servlet directly via http://localhost/forms/ three-params. You should see null for all three parameters. Run it again by starting with threeparams-form.html and submitting the form. You should now see the entries from the textfields.
2. Make a new Eclipse project called exercises-forms (or some such). Use this project for the rest of the exercises. Copy the ThreeParams servlet from my forms project and put it in a new package/directory in your project. Similarly, make a copy of three-params-form.html. Test the servlet and the form.
3. Copy/rename the ThreeParams servlet and associated form and have the new versions use POST instead of GET. Note that you will have to make small changes to both the servlet and the form. You will probably need to restart Tomcat after making the changes (R-click Tomcat and choose Restart).
4. Use three-params-form.html to send data to the ThreeParams servlet that contains HTML-specific characters. Verify that this can cause malformed results. Make a variation of the servlet that filters the strings before displaying them. Be sure to copy ServletUtilities from the forms or test-app project first, so that you can simply do this: someString = ServletUtilities.filter(someString);
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