Hi,
I want to build a complete application J2EE with Portlet in add to Servlet.
The file that I mean is the following:
application.xml
ejbModule.jar
warModule.war
In the warModule.war I want insert for the moment only portlets that references ejbModule's EJBs .
Suppose that I have build the EJB UserEntity (name, surname, userId);
What consideration about deployment descriptors there are to have the following code in my UserPortlet
try {
UserEntityLocalHome userLocalHome = (UserEntityLocalHome) new InitialContext().lookup ("ejb/User");
}
catch (NamingException ne1) {
ne1.printStackTrace();
}
Portlets are identical to Servlets in this aspect, so whatever you'd do for a servlet in the same WAR (ejb-ref in web.xml) works for a portlet as well. The portlet uses the same code as the servlet to get to the ejb.