CS506 Assignment No 3
Semester: Spring 2018 CS506 – Web Design and Development
Problem Statement:
Create a Servlet Based web application to Register and Un-Register Cookies using Servlets and Html pages. You need to create two Servlets and three Html pages.
1Initial page of your application will be index.html where you will get authentication details (Student ID and Password) from student.
- 2Create a MyServlet.java that will take care of the login request and register the Student ID and password fields’ values in cookies variables. [Hard code the values of Student ID as BCXXXXXXX (You must use your own VU ID here) and password as your first name (For example “ali”)].
- 3If values of Student ID and Password are other than your ID and name then print a response message that incorrect user and password is given. The Servlet should not register cookies in this case.
- If values of Student ID and Password are same as your own ID and name then redirect to LoginSuccess.html page by displaying a message “Cookies Registered Successfully”. Also add a button “Logout” in LoginSuccess.html page. [You may set the cookie timeout to 10 minutes].
- When student will click on Logout button then make sure that cookies are removed using LogoutServlet.java and redirect to another html page logout.html by printing a message “Cookies Un-registered Successfully”.
Hint: To remove the cookie, we can set the maximum age to 0 so that it will be deleted from client browser instantly.
Important regarding submission:
You are required to submit following files in compressed (.zip or .rar) format.
1. Index.html
2. LoginSuccess.html
3. logout.html
4. Web.xml
5. MyServlet.java
6. LogoutServlet.java