CS4025 Midterm

8:30am – 9:50am, Feb. 27, 2007

 

Write your answers in booklet(s).

 

1.     (5%) Briefly describe a simple real-world web application that only needs to use client-side computing to display dynamic web pagers within the client browser, using JavaScript or Java Applet. Explain your answer.

 

2.     (5%) Briefly describe a simple real-world web application that needs to use server-side computing to generate web pages dynamically including accessing to data resources such as files and databases on the server. Explain your answer.

 

3.     (10%) Write an as simple as possible XHTML file, login.html, that allows the user to enter her/his user id and password to be submitted to the server side. Assume the form action attribute is “isel.cs.unb.ca” and the form method attribute is “post”.

 

4.     (15%) For the login.html file your created in Question 3, assume that the user entered her/his user id as “abc” and password as “def”.

 

a)     Write the entire HTTP request with minimum necessary header fields that the browser sends to the server side when the file is submitted.

b)     Assume that the form method attribute is changed to “get”, rewrite the HTTP request.

 

5.     (20%) There are three solutions for the state retention problem of web applications: hidden attributes in HTML/FORM, cookies, and sessions.

a)     Give a simple web application example that just needs to use the hidden attribute solution to make its state retention.

·       Write a simple HTML/Form to illustrate what the server sends to the client side.

·       Write a simple algorithm in pseudocode to show how the server side handles it.

b)     Give a simple web application example whose state retention requirement can only be solved using cookies, not others. Briefly explain your answer.

c)     Give a simple web application example whose state retention requirement can only be solved using sessions, not others. Briefly explain your answer.

 

6.     (20%) Write an HTML file with form and JavaScript. The form contains several checkboxes with the following values: CS1073, CS1083, CS2023, CS2043, CS3043, CS4015, and CS4025, and a submit button. When the submit button is clicked, the JavaScript will open a confirmation window to display the values of the checkboxes that are checked by the user. When the user click on OK button in the confirmation window, the form will be submitted to the server side. Otherwise the form will not be submitted.

 

7.     (25%) You are asked to design the following web application. The application allows parking patrol officers to enter information of parking tickets on the website. Drivers can check/view their parking tickets on the website by entering their vehicles’ license numbers.

 

Draw a UML design diagram for your design of the web application, similar to the UML design diagram given for assignment 3.

 

For each class in the design diagram,

·       give a meaningful name and a standard stereotype,

·       indicate which tier it belongs to, client tire, web tier, or database tier, and

·       briefly describe the responsibility of the class.

 

       Also, make sure to describe the relationships between the classes with proper stereotypes.

 

·       For database table, give all its columns.

·       For form, give all its inputs with proper types.

·       For JavaScript, give functions with proper names for checking input entries.