Name

<resource-env-ref>

Synopsis

The <resource-env-ref> element declares an application resource accessible through JNDI.

Syntax

<resource-env-ref>
  [<description [xml:lang="lang"]>description</description>]*
  <resource-env-ref-name>envRefName</resource-env-ref-name>
  <resource-env-ref-type>envRefType</resource-env-ref-type>
</resource-env-ref>

In a complete J2EE-compliant container (i.e., one that supports other J2EE technologies besides servlets and JSP), the container can provide access to so-called administered objects through JNDI. Examples of this type of object are the ones used by the Java Messaging System (JMS) API. The <resource-env-ref> elements declares the JNDI path used to access the object in the application and its type, using nested <resource-env-ref-name> and <resource-end-ref-type> elements:

<resource-env-ref>
  <resource-env-ref-name>/jms/StockQueue</resource-env-ref-name>
  <resource-env-ref-type>/javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>

Optionally, descriptions can be provided by the <description> element.

Get JavaServer Pages, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.