Homework 2
CS320, Fall 2007


Due: Wednesday, October 17

Please upload your files to CSNS. The files should include all the source code, documentation, and an HTML file hw2.html, which contains a link to your servlet on the CS3 server. Note that file uploading will be disabled automatically after 11:59PM of the due date, so please turn in your work on time.


[Reading]

[Login and Logout] (40pt)

Movie review sites usually allow all visitors to view the ratings and reviews of the movies, but only allow registered users to rate and/or review movies. For this assignment, you are going to add this feature to the movie review servlet you developed in Homework 1. In particular, whenever a user tries to add a movie or review a movie, the servlet should first check whether the user is already logged in. If not, the user should be redirected to a Login page, where they must provide a valid username and corresponding password.

It is completely up to you to decide whether to implement this feature with one servlet, two servlets, or some combination of servlets and HTML pages. However, whatever implementation you choose, it has to meet the following requirements:

Note that once you complete the Login feature, a few changes must be made to the user interface. In particular:

[Edit Review] (30pt)

A user may later changes his or her opinion about a movie, thus needs to edit his or her review of the movie. Implement this feature in your servlet. Note that the interface for editing a review is almost identical to the interface for adding a review shown in Homework 1, except that when a user edits a review, the form should be pre-filled with the current information of the review.