Introduction:
To demonstrate your understanding of the topics introduced in the course we will be building a sample enterprise application. I like to keep the projects we build close to what you may see in the real-world. The application we're going to build is a secure online banking application called TOBA Titan Online Banking Application.
Instructions:
For assignment 1 complete the following:
1. Create a Java Web Project called TOBA and in it create the following HTML pages for our application.
a. index.html: This will be the homepage of the application. If you're aesthetically inclined, by all means make it pretty. At the very least, the homepage should have the name of the banking application and a navigation.
Login.html: This page should contain a form with the following input elements and a Login Button. This page should also have a link to a "New Customer Sign Up page", see item c.
i. Username
ii. Password
c. New_customer.jsp: This page will allow the user to register for online banking services. It should have a form with a submit button that collects the following information.
i. FirstName
ii. LastName
iii. Phone
v. City
vi. State
vii. Zipcode
viii. Email
d. Success.html: This page should just display a message that the account has been successfully created.
e. Account_activity.html: This page will be used to display the customer account information. Just add a header for now.
f. Transaction.html: This page will allow a user to post a transaction. Just add a header for now.
g. Login_failure.html: Displays a message that the login was correct.
h. Error_404.jsp: Displays 404 error code.
i. Error_java.jsp: Displays a message that java has thrown an exception.
2. Create the following Servlets:
a. LoginServlet - Code the servlet to retrieve the username and password from the form we added to login.html. Have the survlet check that the username is equal to jsmith@toba.com and the password is equal to "letmein". Make sure you use these values or I can't test your work. If the username and password match, the servlet to forward the request to the account_activity.html page. If it is incorrect, it should forward the request to the login_failure.html page.
b. NewCustomerServlet - Code the servlet to retrieve the new customer form data and just redirect to the success.html page.
c. TransactionServlet - Just create an empty servlet for now.
3. Server Side Validation - Code the NewCustomerServlet to validate the user has entered in values for all the form fields. If not, assign a message variable such as "Please fill out all the form fields" and display the message on the new_customer.jsp page.
4. Web XML - Configure the web.xml to map all your servlets.
5. Error Handling - Add the following:
a. XML tags that provide error-handling for an HTTP 404 status code
b.XML tags that provide error-handling for all Java exceptions
Instructions
For assignment 2 complete the following:
Part A:
1. Lets begin by creating a JavaBean. Create a User JavaBean. The user bean should have all the attributes collected from the new customer form. Also give it a username and password property.
2. In the NewCustomerServlet, create an instance of the User bean from the new customer form data. The username should consist of their last name combined with their zipcode. Give them a temporary password of welcome1.
3. Add the new create user object to the session scope.
4. Using EL, bind the customer object to the success page and display all the attributes along with the new username and password.
Part B:
1. Add a "Reset Password" link to the Login Page.
2. Create a password_reset.jsp
3. Using EL, bind the User object password to a form field in a page.
4. Allow the user to change their password.
5. On the servlet side, retrieve the user from the session and change the password to the password entered on the reset form.
6. Save the User object in session scope.
7. Redirect the user to the account_activity page.
Part C:
1. On the account_activity page use a JSTL if statement. If the User object is in the session and not null, display a welcome message containing their firstname and lastname in the page. If it does not exist, display a "Not Logged In" message on the page.
Part D:
1. Implement a header.html and footer.jsp file for the header and footer of your TOBA application. Using a JSP tag, the footer should "dynamically" display the current date in the copyright information. Include the header and footer in all pages of your application.
1. Create a database connection in your context.xml file.
2. Add the EclipseLink libraries and persistence.xml file.
3. Create a UserDB class with an insert method that inserts the new customer in the db.
4. In the NewCustomerServlet, modify the code to add the new customer to the database using the UserDB class.