EJB references

Servlets and JSPs use EJB references to instantiate proxies for EJB home interfaces. See Chapter 8, “Creating Enterprise JavaBeans Clients,” for more information. EJB references must be cataloged in the deployment descriptor so that the Web application can run independent of a specific naming configuration. When deploying the Web application, a site administrator can specify site-specific EJB JNDI names.

Servlets and JSPs can look up an EJB by specifying the reference name prefixed with java:comp/env/. For example, if you enter ejb/catalog in EAServer Manager, use java:comp/env/ejb/catalog in your JSP or servlet source code.

To add or configure an EJB reference, open the Web Application Properties dialog box.

NoteThe EJB References tab configuration is the same for Web applications, application clients, and EJB components.

StepsAdding an EJB reference

  1. Display the EJB References tab.

  2. Click Add. A reference with default settings is created. Edit the settings as described below.

StepsEditing an EJB reference

  1. If necessary, display the EJB References tab. Existing references are displayed as a list with one row for each reference.

  2. Edit the reference fields of interest as follows:

  3. To delete a reference, click anywhere in the fields for the reference of interest and click Delete.