FINAL
CS320, Fall 2006


Please upload your files to CSNS. The files should include all the source code, documentation, and an HTML file final.html which contains a link to your application on the CS3 server. Note that file uploading will be disabled automatically after 10:00PM, and late submission will not be accepted.

[Introduction]

In this exam you are going to develop an online address book, using, of course, JSP without scripting elements. An address book consists of a number of entries, and each entry contains the contact information of a person, which includes name, address, phone numbers, and email. The application stores the address book in a database, and allows a user to add, delete, edit, and search for contact information.

[Database]

For each entry of the address book, the following information is stored in the database:

You may use as many (or as few) tables and/or fields as necessary. At the end of the exam, you need to turn in a final.sql file which include the SQL statements to create the table(s) in the database, and the statements to populate the table(s) so that there are at least three entries in the address book.

[Display]

The main page of the application is AddressBook.jsp. When this page is requested without any parameters, it displays the entries currently stored in the database as shown below:

Jane
John Doe
Tim Johnson
Tom

[Add New Entry]
Jane
Address: 123 Main St., #456, Los Angeles, CA 91001
Phones: Office:
Home:
Cell: (123) 456-7890
Email: jane@hotmail.com
Delete | Edit

Note that the list of entries shown on the left should be ordered alphabetically by name. A user may select an entry by clicking on the name, and the detailed information of the selected entry is displayed on the right. The selected entry is not "clickable", and by default (i.e. when the page is requested without any parameters), the first entry is selected. 

[Search]

A user may search for the contact information of a person by entering the name (or part of the name) of the person in the search box. The application will display the entries whose name contains the given name (case-insensitive). For example, if a user search for "john", the application should display the following:

John Doe
Tim Johnson

[Add New Entry]
John Doe
Address: 123 State St., #456, Los Angeles, CA 91001
Phones: Office: (345) 678-9012
Home:
Cell:
Email: johndoe@hotmail.com
Delete | Edit

If the search does not return any result, the application should display the following:

Sorry, no entries are found. [Display All Entries]

The user then may perform another search or simply click on the Display All Entries link to view all the entries again.

[Add] 

When a user clicks the Add New Entry link, the application displays the following page which allows the user to add a new entry:

Name (Required):
Address:
Office Phone:
Home Phone:
Cell Phone:
Email:

Note that only the Name field is required, and an error message should be displayed when a user tries to add an entry with an empty name field. The user is redirected to AddressBook.jsp after an entry is added successfully.

[Delete]

To delete an entry from the database, a user may simply click on the Delete link.

[Edit]

A user may edit the contact information by clicking on the Edit link. The Edit interface is similar to the Add interface, except that the form should be pre-filled with the current information of the entry being edited, as shown in the example below:

Name:
Address:
Office Phone:
Home Phone:
Cell Phone:
Email:

After the entry is updated, the application redirects back to AddressBook.jsp.

[Grading Criteria]