Skip to main content

Seperate Web layer and EJB layer modules

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2013-05-12


I want to create Seperate Web layer and EJB layer modules.

Web Layer - JSP/Servlets
Business Llayer - EJB 3

I want to develop separate projects for web layer (.war) and for Business layer (.jar). I want to deploy these layers on different Glassfish servers.

Here is my Approach -

1. Create a separate module for remote interfaces (.jar), use @remote annotations
2. Create a Web module using JSP/Servlets (.war) and use this remote interface jar in it.
3. Create a EJB module (.jar) and implement these remote interface in it.
4. Use JNDI in Web layer to access the EJB methods.

I want to know if this is the correct approach?
Is there any better approach in Java EE 6? Is there any good example which explains this?