Discussions

EJB programming & troubleshooting: Session Facade and servlet client

  1. Session Facade and servlet client (1 messages)

    Hello,
    I have a Stateless session bean acting like a facade between a servlet client and entity ejbs.
    The servlet and the session bean work on the same server.
    My questions are :
    - does the servlet need to access de session bean through jndi (lookup("java:comp/env/ejb....")) or not
    - can the servlet access to the session bean methods throught the local interfaces.
    - does someone know a link to an example.
    Thanx
    Thomas
  2. You might want to look into the business delegate pattern. Not sure if you want the servlet to access the stateless bean directly. If you use another layer, helper/delegate, then you can have that layer create a reference to the EJBHome of the stateless bean. Then the servlet can access the the helper class, or even better a jsp that accesses the helper class. This is just an example of things we do, but not sure if it fits your situation. cb