Homework 5
CS320, Fall 2005


Due: Tuesday, Nov 22

Please upload your files using the online turnin server. The files should include all the source code, documentation, and an HTML file hw5.html, which contains a link to your JSP page 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]
[Problem Description]

For this assignment, add a registration page to the online bookmark manager you developed in Homework 4 so a user can create an new account. Also implement a custom tag <logout> so we can get rid of the last bit of scripting element from the application. Again, all features described in previous assignments must work; otherwise there will be a credit penalty of up to 30pt.
[Registration Page] (40pt)

In the registration page, ask the user to fill out a form for username, password, first name, last name, and email, as shown in the following example:

Username:

Password:

Retype password:

First Name (optional):

Last Name (optional):

Email (optional):


Your application should properly handle the following situations:
For each type of errors, output an error message and ask the user to re-enter the data. Note that validation of the input data should be implemented on the server side.
[Logout Tag] (20pt)

Implement a <logout> tag so that instead of using scriptlets as described in Homework 3, your logout code should look somewhat like the following:
<c:if test="${! empty param.logout}">
    <bb:logout />
    <c:redirect url="Home.jsp" />
</c:if>
[Extra Credit Work]

For extra credit, modify your application so that it supports two types of users: regular and admin. Once an admin user is logged in, he or she can perform several operations that are not available to regular users:
For even more extra credit, implement the following features:
Also create a JSP page so admin users can view this log.
Note that this tag may comes in handy when you try to display a list of folders in your bookmark manager application, for example:

<c:forEach items="${folders}" var="f">
<cs320:smartLink test="${f.id != currentFolder.id}" href="BookmarkManager.jsp?folder=${f.id}">f.name</cs320:smartLink>
</c:forEach>

The due date for the extra credit work is Tuesday, November 29, and you may turn it in as Homework 6. A hw6.html must be included, which contains a link to your JSP page on the CS server, and states which feature(s) you have implemented.