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