Deployment descriptor

(i) Copy CookieAdder.html into your Web app’s root folder. Then copy CookieAdder.javaGetPreferences.java and ShowSum.java into the classes folder

(ii) Add the appropriate tags to your deployment descriptor and compile the three servlets.

(iii) Start up Tomcat (stopping it first, if it is already running) and then access

the above Web page via your browser. Experiment with differing input to the

Web page. Notice that you will not be permitted to change your preferences

immediately after entering them. However, since the cookies will ‘time out’ after

3 minutes, you will be able to experiment with other values if you wait for this

timeout and then re-load the initial page.

(iv) Modify ShowSum.java so that the result page shows either the date and

time of the user’s last visit to the page or, if it is the user’s first visit, a messageto indicate this. [Use new to create a Date object (package java.util) and the

Date object’s toString method to place the date value into a cookie.] Re-compile

the servlet.

(v) Stop Tomcat, re-start it and then re-test the above application with the

modified servlet.

WhatsApp
Hello! Need help with your assignments?

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

🛡️ Worried About Plagiarism? Run a Free Turnitin Check Today!
Get peace of mind with a 100% AI-Free Report and expert editing assistance.

X