0% found this document useful (0 votes)
65 views3 pages

Web Final Spring 2011

This document outlines a final exam for a web application development course. It provides instructions for students to build a simple website with login/logout functionality based on the MVC model. It contains 4 questions: 1) Create a ProfileBean class with get/set properties for username, password, and read-only properties for other user details. 2) Write a controller class to control the login/logout workflow and check if a user is logged in by looking for a profile bean in the session. 3) Create 4 JSP views - a main menu, login page, profile page, and logout page - to display content and submit actions to the controller. 4) Modify the logout page to

Uploaded by

Nguyen Hoang Anh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views3 pages

Web Final Spring 2011

This document outlines a final exam for a web application development course. It provides instructions for students to build a simple website with login/logout functionality based on the MVC model. It contains 4 questions: 1) Create a ProfileBean class with get/set properties for username, password, and read-only properties for other user details. 2) Write a controller class to control the login/logout workflow and check if a user is logged in by looking for a profile bean in the session. 3) Create 4 JSP views - a main menu, login page, profile page, and logout page - to display content and submit actions to the controller. 4) Modify the logout page to

Uploaded by

Nguyen Hoang Anh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Final Examination Date: 08/06/2011 Duration: 120 minutes SUBJECT: Web Application Development Dean of School of Computer Science

and Engineering Signature:

Lecturer: Vo Duy Khoi Signature:

Full name: Dr. Nguyen Duc Cuong INSTRUCTIONS:

Full name: Vo Duy Khoi

Notes: This is an open test. Notebook is allowed to use. The total point of the final-exam is 100.

Scenario explanation This exam aims to build a website based on MVC model. The model contains: - One controller named: FinalController - Three views named and 1 menu page: index.jsp (contains Main Menu); Login.jsp; viewProfile.jsp; and Logout.jsp Main flow of site actions is as follows: Login Yes Process Login

Main menu

Login? No View Profile? No Logout? Yes FinalController Yes No Already Login? Yes View Profile

Back to Main menu

Question 1: (20 points) Write a bean named ProfileBean with properties as details: - Username: can be get/set.

- Password: can be set/get - Year Of Birth: can be get only - Country: can be get only - Message: can be get only. If username/password are john/123456 then message will be You successfully login. Otherwise, message will be Invalid login

Question 2: (40 points) Controller implementation Write code to implement the controller to control the flow as figure above. In the controller, process to check if user is logged in or not is done by detecting the present of a profile bean. If profile bean is present in session object, user already logged in. Otherwise user did not log in. In case user did not log in, create a new profile bean with submitted information. Assume action strings are Login, Submit Login, View Profile, and Logout corresponding to login action, login submission action, view profile action and logout action respectively.

Question 3: (20 points) Views implementation - Index.jsp (main menu): display hyperlink to each view via controller - Login.jsp: display login page and submit data to controller with Login action string - viewProfile.jsp: display profile bean information retrieved from session object (if user logged in) - Logout.jsp: destroy session bean and display a message: You successfully logged out. The interfaces of the views can be referred to following figures:

Main menu

Login

View profile

Question 4: (20 points) Write code to change logout page to simple AJAX action using function document.write() to display whole page sent from controller. END

You might also like