[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]
|
||||
|
||||
|
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
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.
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.