EE4216/EE5816 Internet Client-Server Computing
Java network Programming
Assignment 2
Due date: 31 March 2009 (Tue), 11:55PM
This assignment is an extension of tutorial 5. Please take note of the following requirements, otherwise the grader will not be able to execute your programs and marks will be deducted.
1. The database file is PhoneDB.mdb, and the DSN used in your application should be PhoneDB.
2. The welcome page of your application should be called PhoneDir.html, and the servlet for handling the HTML-form request is called DBservlet.java
3. On the welcome page, the user are provided with the option for the following 3 operations:
Search : Search for the telephone numbers that match the given name(s) in the database. In this operation, the Lastname field should not be unspecified, but the Firstname field can be left empty.
The search is based on prefix-match of the name(s). For example, if the user only enters “Ch” in the Lastname field, then the following phone records will match the specified name:
Chan Tai Man
Chan Tin Ming
Cheung Chi Keung
If the user has entered “Ch” in the Lastname field, and “T” in the Firstname field, then the search result should only contain
Chan Tai man
Chan Tin Ming
The Search result is not shown on the TelNum field in the current browser window, instead the names and phone numbers are shown on a new browser window.
Update : Update the phone record. In this operation, the user is expected to enter the full name, i.e. both the Lastname and Firstname, and the phone number. If the user misses out any one of the required fields, the browser will pop up an alert dialog to remind the user to enter the missing information.
If a phone record with the given names (exact match of the names) already exists in the database, the existing record will be replaced. If there is no phone record with the given name exists in the system, then a new record will be added to the database.
The user is notified of the result of the update operation, i.e. whether an existing record has been modified or a new record
has been added, via an alert dialog.
* Delete : Delete the phone record that matches the given Lastname and Firstname (Exact match willbe used in the Delete operation). The user is notified of the result of the delete operation, i.e. whether the operation is successful or not (record not found), via an alert dialog.
4. You are free to (i) modify the html file (with embedded JavaScript), (ii) modify DBservlet.java, and (iii) include other JSPs in your application.
Keine Kommentare:
Kommentar veröffentlichen