Hello Victor Larr, In WebSphere you can even access local ejb directly in jsp page 1. Does the above behaviour happen only if the web application and enterprise bean are in the same JVM? 2. Is the above behaviour true if the web application and enterprise bean are in different JVM's (I think the above behaviour will not be exhibited in case number 2, if it does then I don't understand EJB's )?
Sany Bel --> Can we lookup a entity beans local interface through action classes (Struts)?
I think you can if struts application and enterprise bean are in same JVM otherwise not. Thanks, Santosh
Joined: Mar 29, 2004
Yes you can access local EJB only if web container and ejb container runs inside the same JVM. For ejb lookup you put the same code in jsp as in a regular java class. <% Context context = new InitialContext(); MyEJBHome home = (MyEJBHome)context.lookup("myEJB"); MyEJB ejb = home.create(); %> It is good for testing. But in a real development this code should be moved to a helper class.