Question: Provide code for Java Servlets with the following properties: The rst servlet serves GET requests. This servlet displays a form where the user can enter
Provide code for Java Servlets with the following properties:
The rst servlet serves GET requests. This servlet displays a form where the user can enter a name and two numbers. The servlet will test whether a cookie named username is send by the client and if so, it will use the value of that cookie as the default value of the entry eld for the name. The form will use the second servlet as target using a POST request.
The second servlet will set a cookie called username with the value of the passed name parameter. Further, it will display the results of adding, subtracting, multiplying and dividing the two numbers passed in the form. Make sure your servlet will not terminate if the number elds contain illegal (i.e. non-number) values. This servlet will also provide a link back to the rst servlet.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
