Homework 2
CS320, Spring 2005


Due: Thursday, April 21

Please upload your files using the online turnin server. The files should include all the source code, documentation, and an HTML file hw2.html, which contains a link to your servlet on the CS 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)

Most bulletin boards allow all visitors to view the content of the board, but only allow registered users to create new topics or post replies. For this assignment, you are going to add this feature to the bulletin board servlet you developed in Homework 1. In particular, whenever a user tries to create a new topic or post a reply, 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 implemention you choose, it has to meet the following requirements: [Create New Topics] (40pt)

Topics Replies Author Views Last Post
Tomcat Installation Problem 1 John Doe 8 Tue Apr 05 10:03:33 PDT 2005
Please HELP! 0 Somebody 6 Wed Apr 06 14:08:49 PDT 2005
Unable to Login the Turnin Server 1 cs320stu00 2 Thr Apr 07 21:09:20 PDT 2005
Subject:
Content::
(a)  A "New Topic" Button
(b) Topic Input
Figure 1. Interface for Creating a New Topic

Modify your bulletin board interface so that a user can create new topics. For example, add a "New Topic" button or link as shown in Figure 1(a), and when a user click on the button, the servlet displays a web form, so the user can type in the subject and the content of the new topic, as shown in Figure 1(b). Note that only users who have logged in can access the web form, and  if a user has not logged in yet, clicking on the New Topic button should bring him or her to the Login page. Also note that you should create a similar interface for posting replies.