Anda di halaman 1dari 3

Assignment Test

Subject : JSP
Date :
Duration : 120 minutes

Question 1 : Creating database

1. Create a MS ACCESS database named Customer with the following tables :

Column Name Data type Description Constraints
CustomerID AutoNumber ID code Primary Key
FirstName Text(50)
LastName Text(50)
Addr1 Text(50)
Addr2 Text(50)

Table : USER
Column Name Data type Description Constraints
Id AutoNumber ID code Primary Key
FirstName Text(50)
LastName Text(50)
Email Text(50)
Sex Yes/No
Address Text(50)

2. Create an ODBC DSN named jsptest connects to the above database.

3. All JSP application in this assignment use this jsptest datasource name.

Question 2 : Developing JSP Application

1. Create a JSP page named CustomerRegistration.jsp to insert a new customer to CUSTOMER table :
When user send the first request, the page will be displayed as the following

Insert a new Customer into Customer table

The field name :
FirstName,LastName,Address1 are required field. User will be prompted when sending form
(press Update button) without filling any one of these required fields.
The old value of the previous fields will be saved when performing validation.
Example :

Validation process of required fields will be performed on the server-side using JSP technology, NOT
Question 3 : Developing JSP Application using JavaBean
1. Create a HTML page named RegistrationForm.html to insert a new user to USER table


Using JavaBean to store all the fields in RegistrationForm.html and re-display it for confirmation :

Back : Jump back to RegistrationForm.html to edit the user information

Accept : Agree to insert new USER into USER table.
When user press Accept link, new USER record is inserted and USER will be redirected to
RegistrationForm.html page.

Question 4 : Developing JSP Application using JSP taglib

1. Create a JSP taglib named displayTable to display all data from any table in tabular form.
2. Create a JSP page named DisplayTable.jsp to demonstrate the usage of the above taglib as following :

<tableTagLib:displayTable tableName=User/>

will query USER table and display all data in tabular form