If you find these tutorials useful, Please consider making a donation.

TheFrugalComputerGuy.png
TheFrugalComputerLogo.png

J2EE Registration Project - Group 2










Video 4 - Show Database Page

We create a Servlet (in the client tier) that uses the ejb local interface (in the Bisiness Tier) to display infromation from the database (in the Enterprise Tier).

I right click on the RegistrationProject-war module to create a new – other – web – servlet.

I type in the annotation @EJB and private to access the interface FacadeLocal ejb create in the previous video. We then need to fix imports to prevent the error messages.

I then remove the current HTML and paste in HTML code that can be downloaded (for free) from thefrugalcomputerguy.com/j2eeregistryproject

We take a quick look at the code pasted in and create some CSS (and paste in code downloaded from thefrugalcomptuerguy.com/j2eeregistryproject

The code is briefly explained.

We need to deploy the RegrstrationProject-ejb module – this should have been done in the previous video.

Right clicking on the RegistrationProject (triangle) clean and build project, then right click again on the triangle and run.

We need to type in the servlet name to bring it up, and we see the results in our browser window.










Video 5 - Registration and Confirmation

We complete the project by creating the Registration Page and the Confirmation Page.

We right click on the RegistrationProject-war module new – other – Web – Servlet.

We do the same as the previous video, we add the @EJB annotation and the code for the FacadeLocal interface. We also paste in some code (available for free from thefrugalcomputerguy.com/j2eeregistrationproject, only this time, this servlet is not in the client tier, it is in the web tier (It is not seen by the client).

We create two JSP webpages for the registration page and teh confirmation page and paste in some code available from thefrugalcomptuerguy.com/j2eeregistrationproject. The registration page input form asks the client to type in the information requested (note: no data validation is done in this program, but should be done in a real world environment) when the submit button is pressed, the information is passed to the servlet, which will check the zipcode to be numeric (note: all field should be validated for a real world environment). If there is invalid data, we go back to the registration page with an error message, if the data passes validation, the facadeLocal interface will insert the new record into the table. If the create is successful the information will be passed to the confirmation page and displayed on that webpage.