Run:
  CallEJB.jsp
   

View:
CallEJB.jsp
EmployeeEJBWrapper.java
 
 
 

Calling EJB Sample 

This sample illustrates how to invoke an EJB object in JSP. It assumes /test/employeeBean is already deployed and published in your Oracle9i JServer. To do that, refer to $ORACLE_HOME/jsp/demo/README for the steps

This demo makes use of the employeeBean EJB to lookup the employee information for a given employee number submitted by users through an HTML form. For simplicity, we perform a lookup in every HTTP request. In order to speed up the performance, developers should consider storing the EJB instance in the HTTP session and matching the lifecycle of the HTTP Session and the EJB Session using HttpSessionBindingListener.

To encapsulate the details of the jndi lookup there is an EJB Wrapper Bean which also is used to preserve the parameters values between iterations.