FINAL
CS320, Fall 2005


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 a link to your application on the CS server. Note that file uploading will be disabled automatically after 12:45PM, and late turnin will not be accepted.

[Problem Description]

Many online documents nowadays, such as the manuals of PHP and MySQL, allow users to add comments or notes to the documents. In this exam, you are going to add this functionality to the two documents we used in class, Tomcat Setup and Configuration and MySQL Setup and Configuration, using JSP without scripting elements

[Display]

Convert the two documents to JSP, e.g. tomcat.jsp and mysql.jsp, and when a document is requested without any parameters, displays the content of the document as well as the user comments associated with it, for example:

Setup and Configuration Guide for Something

[content]
User Comments: Add Comment
csun at calstatela dot edu, 2005-12-04 15:50:23PM [delete]
When you set an environment value on WinXP (My Computer -> properties -> Advanced -> Environment Variable), you will get two text boxes: one is called "Variable name" and one is called "Variable value". In the "Variable name" box, type CLASSPATH, in the "Variable value" box, type .;C:\Documents and Settings\Dan\My Documents\jakarta-tomcat-5.5.9\common\lib\servlet-api.jar
Note that you don't need quotes around the path. Then click OK, OK, OK. Then logout, then login again. Your classpath should be set.
jdoe at hotmail dot com, 2005-11-05 11:20:32AM [delete]
There is no instruction about how to set environment variables.

Note that the comments are displayed in the reverse order of the time when they were added, with the most recent comment displayed first.

[Add Comment]

When a user clicks the Add Comment link, displays an AddComment.jsp page where the user may add their comment, for example:

Email:
Comment:

Note that

[Delete Comment]

Any user can add comments, but only authorized users can delete comments. When a user clicks the Delete link, displays a DelComment.jsp page as follows where the user must enter a valid pair of username and password before the comment is deleted.

Username:
Password:

Note that

[Database]

All the information about the users and the comments should be stored in a database. At the end of the exam, you need to turn in an SQL script file final.sql, which include the statements to create all the tables in the database, and the statements to populate the tables so that there are at least two usrs in the database (user cysun with password abcd being one of them), and each document has at least three comments.

[Email Tag]

To protect the user email addresses from being harvested by spammers, create a custom tag <noSpam> which converts an email address to something more "text-like". In particular, the tag replaces "@" in an email address with " at ", and "." with " dot ". For example, <cs320:noSpam>csun@calstatela.edu</cs320:noSpam> would display csun at calstatela dot edu. Note that the email address is given as the body content of the tag, not as an attribute value.

[Grading Criteria]