hi,
if servlets and ur ejbs are in same application server then
expose remote interfaces of the session beans to the servlets
expose local interfaces of the entity beans to the session beans
sample code for calling remote interface(SB) from a servlet is :
        try{
            javax.naming.InitialContext ctxt = new javax.naming.InitialContext();
            Object obj = ctxt.lookup("java:comp/env/ejb/SessionBeanName");
            home = 
(SessionBeanHome)javax.rmi.PortableRemoteObject.narrow(SessionBeanHome.class);
            remote = home.create();
        }catch(Exception e){e.printStackTrace(System.out);}
sample code for calling local interface(EB) from a session bean is :
            try{
                javax.ejb.EJBLocalHome home = null;
                home = 
(javax.ejb.EJBLocalHome)context.lookup("java:comp/env/ejb/EntityBeanName");
        }catch(Exception e){e.printStackTrace(System.out);}


regards
vasu

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to