You want to access an Enterprise JavaBean (EJB) from a servlet on WebLogic.
Find out the EJB's JNDI name and
package to get a
reference to the
or remote interface so
that you can call the
A servlet accesses an EJB by using a specified JNDI name. The process is therefore transparent to the servlet developer. Any EJBs an application uses comprise the business tier of an application. The servlets and JSPs represent the web tier within the multi-tiered distributed architecture of a typical Java 2 Enterprise Edition (J2EE) application. All you need to know is the JNDI name associated with the EJB in order to use the EJB in your programs.
Enterprise JavaBeans is a comprehensive topic; however, this recipe is devoted to showing how a servlet can connect to an EJB. The "See Also" segment of this recipe includes several links to EJB and J2EE information and books.
You should be aware of the EJB's
business methods, but do
not have to be an expert
package to use the EJB.
shows the source code for
a stateless session EJB
that is managed by BEA
WebLogic 7.0 application
A certain type of EJB, a stateless session bean encapsulates business logic that does not require persistence or the saving of the object's state between method calls. On the other hand, a stateful session bean (such as a shopping cart object), must remember the object's ...