Web Final Spring 2011

download Web Final Spring 2011

of 3

Transcript of Web Final Spring 2011

  • 7/27/2019 Web Final Spring 2011

    1/3

    Final Examination

    Date: 08/06/2011

    Duration: 120 minutes

    SUBJECT: Web Application Development

    Dean of School of Computer Science and EngineeringSignature:

    Full name: Dr. Nguyen Duc Cuong

    Lecturer: Vo Duy KhoiSignature:

    Full name: Vo Duy Khoi

    INSTRUCTIONS:

    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:

    Question 1: (20 points) Write a bean named ProfileBean with properties as details:

    - Username: can be get/set.

    FinalController

    Main menu Login?

    View Profile?

    Logout?

    Already Login? View Profile

    Login

    Yes

    No

    No

    No

    Yes Yes

    Yes

    Process Login

    Back to Main menu

  • 7/27/2019 Web Final Spring 2011

    2/3

    - 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

  • 7/27/2019 Web Final Spring 2011

    3/3

    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