Java Web Application Programming

Total Page:16

File Type:pdf, Size:1020Kb

Java Web Application Programming

CPAN423 Enterprise Java Programming

Assignment#2:

Due Date: July 4, 2006 at the beginning of the class

Write a database web application using JSP/servlet that contains the following components:

 A controller servlet called gate.java that is responsible for forwarding the request to the proper page according to the user action.  A JSP page called logon.jsp that enables the user to logon to Oracle Database server at Humber. This page should provide an HTML form with following:  A text field for user ID.  A password field for user password.  Submit and Reset buttons. This form must be submitted to the controller servlet. Store the user ID/password into a session object. When the user accesses logon.jsp page again in the same session, the form should be filled for him/her automatically.  When the controller receives the logon request from logon.jsp, it should forward the user to check.jsp.  A JSP page called check.jsp that checks the user logon. It should utilize a javabean to perform the validation against the database using the user ID/password in the session object. check.jsp should forward the result of the logon to the servlet controller.  When the controller servlet receive the request from check.jsp, it should check the result of the logon. If the logon is successful, it should forward the request to view.jsp. If the logon is not successful, display a login failed message and regenerate the login form.  view.jsp page should provides an HTML form with the following:  A dropdown list with all the available tables that belong to this user (you have to query the database to find the corresponding tables). The user can select any table for querying or manipulating.  Submit button.

This form should be submitted to the controller servlet.  When the controller receives the request from view.jsp, it should forward it to a JSP page called dbManager.jsp.

 dbManager.jsp. page should provide an HTML form with the following:  The fields of the selected table and their types presented in an HTML tabular format.  A textbox field to query and manipulate this table. The user should be able to use any of the commands: insert, update, delete or select.

1  Submit and Reset buttons.

This form should be submitted to the servlet controller.

 When the controller receives the request from dbManager.jsp, it should forward it to a JSP page called procees.jsp.

 process.jsp page is responsible for processesing the SQL statement received from dbManager.jsp (through the controller). If the user is using select command, query the database, and store the result set into a javabean. The javabaen should provide a method to display the result set in an HTML tabular format. If the user is using other command (insert, update or delete), execute this command, and display the number of affected rows. After executing the specified SQL command, process.jsp should forward the request to the controller and the controller should forward the request to check.jsp so the user can issue more SQL commands.

 An error page called error.jsp to handle any exception that may occur in any of the above JSP files.

 You are also required to create a custom empty tag that has the following attributes:  The name of the application developer.  The email address of the application developer.  The last modification date of this application. All the attributes are required. This tag must be displayed as a list of items containing all the supplied attributes at the right bottom corner of each JSP file in this application.

Note:

 You are required to provide the proper information to the controller servlet to keep track of the current user action.  Submit a copy of the source code on a diskette labeled with your name , and student ID.  Late assignments will not be accepted.

2

Recommended publications