Assignment 4
Assignment 4
Due: Wednesday, 19th November 2014, by 5pm. (Note that D2L will not allow late submissions!)
Submission: Create a .zip archive of the entire project directory and upload it to D2L. Please DO NOT
email the submission to the instructor!
Problem
For this assignment you are required to build a web application called ValidateWithEJB. This application
uses Stateless Enterprise Session Beans (SLSB) to validate a users login attempts (against our users
MySQL database), and to manage the users password reset or account deletion.
The main focus of this assignment is the correct use of the SLJBs to perform back-end work on behalf of
the application. There is no requirement to secure the main page of the application (admin.jsp), so its
alright if users can navigate directly to that page without logging in.
The application must be implemented as a NetBeans Java EE/Enterprise Application project called
ValidateWithEJB. The JSPs and servlets must go in the -war sub-project, and the SLSBs must be
implemented in the -ejb sub-project.
Page 1 of 5
Screenshot 3: user provides invalid user data and clicks on Login button
Screenshot 4: user provides valid user data and clicks on Login button
The list of users is dependent upon the contents of the users table in the database.
Page 2 of 5
The Logout hyperlink is a simple link back to the login page. There is no requirement to destroy
sessions, etc.
Screenshot 5: User clicks on the Reset link beside adam in the list
Notice the message Password reset has appeared above the table of users. In the database adams
password has been reset to the word password.
Screenshot 6: User clicks on the Delete link beside adam in the list
The message User deleted appears above the table. The row for adam has been deleted from the
users table in the database, so he disappears from the user list.
Page 3 of 5
JSPs for presentation (with appropriate helper class1 to generate HTML table)
Stateless Session Beans (SLSB) to perform application database operations on behalf of the
servlets. Only the SLSBs may update data in the database!
The application must connect to the database via a connection pool with a JNDI name of
jdbc/assign4Pool. You are being given a .sql file containing the database to use (including stored
procedures). You must use this database as-is, you can only change the data in the table, not the table
structure or the stored procedures.
The helper class can connect to the database and run a stored procedure (getAllUsers) to return the user data (it
may not update the database!)
Page 4 of 5
The following diagram shows how you could structure your solution:
Page 5 of 5