[Introduction]
I have many CDs, and it would take a lot of space to keep them in their original packages. So instead, I keep my CDs in CD storage boxes, like the one shown in the image on the right (click on the image to see a larger version). Note that a CD storage box contains a number of CD sleeves, and each sleeve is numbered and can hold one CD.
The problem with a large CD collection is that it's quite difficult to find a CD unless you know exactly where it is. So in this exam, you are going to develop a web application that helps me manage my CD collection, using, of course, JSP without scripting elements. In the rest of the problem description, we will refer to this application as CDList.
[Database]CDList stores information in a databases, which consists of at lease two tables, one for the boxes and one for the CDs. The box table contains the following information:
[Display]
The main page of the application is CDList.jsp. When this page is requested without any parameters, it displays the CDs currently stored in the database as shown below:
Add New CD | Display All CDs | ||||||||||||||||||||||||||
|
[Search]
A user may search for CDs by giving a keyword, and the application will display only the CDs whose name contains the keyword (case-insensitive). For example, if a user search for "camera", the application should displays the following:
Add New CD | Display All CDs | |||||||||||
|
If the search does not return any result, the application should display the following:
Add New CD | Display All CDs | ||
|
The user then may perform another search or simply click on the Display All CDs link to view all the CDs again.
[Add]
When a user clicks the Add New CD link, the application displays the following page which allows the user to add a new CD:
Box ID: | |
Sleeve #: | |
Name | |
Serial | |
To receive full credit for the Add feature, your implementation must meet the following requirements:
The application should redirect back to the main CDList.jsp page after a CD is added.
[Delete]
To delete a CD from the database, a user may simply click on the corresponding Delete link.
[Edit]A user may edit the information about a CD by clicking on the corresponding 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 CD (including the right box ID being selected), as shown in the example below:
Box: | |
Sleeve #: | |
Name | |
Serial | |
And also like in the Add feature, you application should check whether the combination of the box ID and the sleeve number conflicts with any other CD in the database. After the new information of the CD is saved, the application redirects back to CDList.jsp.
[Grading Criteria]