EJB References Property Editor
 |
Note that this feature might not be included in
your version of the IDE. If it is not available, you can edit the deployment
descriptor (web.xml) file using the editor of your choice.
For more information, see Java Servlet 2.3 Specification available
at http://java.sun.com/products/servlet . |
You can use the EJB References property editor to specify, edit, and remove
EJB references from the web module. You must declare an EJB reference when a
component within the web module programmatically looks up an EJB component through
JNDI. Examples of components within web modules are a JSP, servlet, JavaBean,
or Java class. This declaration indicates to the deployer and the web container
that the environment must be able to resolve the JNDI call to an EJB component.
Note that each entry corresponds to an <ejb-ref>
element
in the deployment descriptor.
To display the EJB References property editor:
- Click the References tab of the web.xml property sheet.
- Click the EJB References value field to make the ellipsis button
appear. By default, there are no EJB references.
- Then click the ellipsis button to display the property editor.
To add EJB references:
- From the EJB References property editor, click the Add button. The Add EJB
Reference dialog box appears.
- Type the name of the EJB reference in the Reference Name text field. Its
value is the name used in the lookup code. By convention, the reference name
is located in the ejb subcontext of the bean's environment, although
this exact location is not required. By default, ejb/ appears in
the text field. Type the EJB reference name, as specified in your lookup code.
For example, you might type ejb/CalendarServiceRef.
- Type an optional description of the referenced enterprise bean in the Description
text field. For instance, type A service that provides calendar management
features. You must supply all the values in steps 5 through 7 below.
To enter all these values at once, select an EJB in the IDE. All the following
values are extracted:
type
, home
interface
,
and remote interface
.
- Use the Browse button to select an EJB component within the IDE. This EJB
component might have the same name as the EJB reference, but it is not required.
- Choose the type of the EJB from the combo box. You can choose between Session
and Entity EJB. Your decision depends upon the type of EJB requested. Generally,
the EJB has already been coded by the programmer or at least specified by
the designer when you are filling out this information. Therefore, you should
use the type as specified by the EJB programmer or designer.
- Enter the class name of the home interface for the EJB in the Home Interface
text field, or press the Browse button to use the Select a Home Interface
dialog box to navigate to the location of the desired home interface. A home
interface must extend the javax.ejb.EJBHome interface.
- Enter the class name of the remote interface for the EJB in the Remote Interface
text field. You can also press the Browse button to use the Select a Remote
Inteface dialog box. From this dialog box, you can navigate to the location
of the desired remote interface. A remote interface must extend the javax.ejb.EJBObject
interface. The relationship between the home and remote interfaces is
maintained by the EJB itself.
- Click OK. The information you have specified is reflected in the EJB References
property editor.
To edit EJB references:
- From the EJB References property editor,
select the desired EJB reference information, and click the Edit button.
The Edit EJB References dialog box appears.
- Edit the name of the referenced enterprise bean in the Reference Name text
field.
- Edit the description of the referenced enterprise bean in the Description
text field.
- Use the Browse button to change the name of the referenced enterprise bean in the
Reference Name text
field.
- Change the type of the EJB from the combo box. You can choose between
Session and Entity.
- Edit the class name of the home interface for the EJB in the Home Interface
text field. You can also press the Browse button to use the Select a Home Interface dialog
box. From this dialog box, you can navigate to the location of the desired home interface.
- Edit the class name of the remote interface for the EJB in the Remote
Interface text field. You can also press the Browse button to use the Select a Remote
Interface dialog box. From this dialog box, you can navigate
to the location of the desired remote interface.
- Click OK. The information you have specified is reflected in appropriate
entries the EJB References property editor.
To remove EJB references:
- From the EJB References property editor,
click the desired EJB reference and the Remove button.
The EJB reference is removed from the table.
- Click OK to confirm the action or click Cancel to stop the action.
Legal Notices