Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Call differ session beans...

T.J. Barry
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a servlet that I want to call different session beans that utilize the same Interfaces (home and remote). Is this possible?
For instance:

Object o = new InitialContext().lookup("java:comp/env/testEJB");
TestHome home = (TestHome)javax.rmi.PortableRemoteObject.narrow(o, TestHome.class);

I know that in the interface I put

public interface TestHome extends javax.ejb.EJBHome {
public static final String COMP_NAME = "java:comp/env/ejb/TestSessionBean";
public static final String JNDI_NAME = "ejb/org/test/TestHome";

What if I want the Bean I call to be dynamic? like I pass the this possible? Or am I going about this the wrong way?
Any help would be appreciated.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic