The J2EETM Tutorial
Home
TOC
PREV TOC NEXT Search
Feedback

Specifying the JNDI Name

Although the J2EE application client and the web client access the same enterprise bean, their code refers to the bean by different names. The J2EE application client refers to the bean as SimpleConverter, but the web client refers to it as TheConverter. These references are in the parameters of the lookup calls. In order for the lookup method to retrieve the bean, you must map the references in the code to the bean's JNDI name. Although this mapping adds a level of indirection, it decouples the clients and the beans, making it easier to assemble applications from J2EE components.

To map the bean references in the clients to the JNDI name of the bean, follow these steps:

  1. In the tree, select ConverterApp.
  2. Select the JNDI Names tab.
  3. To specify a JNDI name for the bean, in the Application table locate the ConverterBean component and enter MyConverter in the JNDI Name column.
  4. To map the references, in the References table enter MyConverter in the JNDI Name for each row.

Home
TOC
PREV TOC NEXT Search
Feedback