J2EE Registration Project (04) – Show Database Page

preview_player
Показать описание
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.

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.
Рекомендации по теме