FINAL
CS320, Fall 2004


Please upload your files using the online turnin server. The files should include all the source code, documentation, and an HTML file final.html which contains links to your JSP pages on the CS server. Note that file uploading will be disabled automatically after 4:05PM, and late turnin will not be accepted.


[Introduction]

Once upon a time, in a state university far far away, web programming classes taught JSP instead of ASP or PHP. The instructor who taught these classes believed that in many ways, JSP was the best choice, and probably more importantly, the three technologies were so similar that once the students mastered one of them, they could easily pick up the other two. Unfortunately, the students didn't always agree, and once in a while, a conversation like this would take place:
Student: I heard JSP is dying and everybody will use ASP, and I want to be a software architect!
Instructor: There are lots of web applications using JSP, especially at the enterprise level, so JSP is probably not going to die any time soon.
Student: Then name a few of those "enterprise" websites.
Instructor: Hmmm ... java.sun.com?
One day, the instructor decided to end the embarrassment, and develop a knowledge base that provide information about the web technologies used by various websites. In this exam, you are going to help the instructor implement the system, using, of course, JSP without scripting elements.

[Base System]

In its simplest form, the knowledge base consists of a Submit page, a Display page, and a backend database.

Using the Submit page, a user may submit to the database the information about a website, which we will refer to as a record. A record includes the URL and the description of the website, the technology the website uses, and optionally, some comments about the website. For example:
Technology:
URL:
Description:
Comments (optional):


The Display page displays the records currently stored in the database, as shown below:
All
JSP
ASP
PHP
Technology
URL
Description
Comments
JSP
www.mhhe.com
McGraw Hill Higher Education
From the *.do extensions, it looks like the site uses Struts.
Total: 1
By default, all records in the database are displayed, but when a user click on one of the links above the table, e.g. All, JSP, ASP, or PHP, the display should change so that it only shows the records of the websites that use the selected technology(s). Note that the value of Total should also change accordingly.

[Enhancements]

Once the base system is up and running, we can improve it in a number of ways. For instance,
  1. We limit the number of records submitted from one IP address in one day to 5. This would, hopefully, discourage malicious users from flooding the database with false information.
  2. To further ensure data quality, we introduce an system administrator, who is responsible for reviewing user submitted records. The Display page will only show the records that are approved by the administrator. For this feature, you will need to implement an password-protected Admin page, which displays the records that have not been reviewed. For each record on the Admin page, the administrator may choose to either delete it or approve it.
  3. It is possible that multiple records are submitted for the same website, which is uniquely identified by its URL. To deal with this situation, the system follows two simple rules:
  4. Create an error page to catch the runtime exceptions raised by the Submit and the Display page. The error page uses a <cs320:log> custom tag to log the request time, request URI, and the exception message to a database table.
[Grading Criteria]