Name

<resource-ref>

Synopsis

The <resource-ref> element defines JNDI accessible object factories for application objects.

Syntax

<resource-ref>
  [<description [xml:lang="lang"]>description</description>]*
  <res-ref-name>refName</res-ref-name>
  <res-ref-type>refType</res-ref-type>
  <res-auth>Application|Container</res-auth>
  [<res-sharing-scope>Shareable|Unshareable</res-sharing-scope>]
</resource-ref>

A J2EE-compliant container (and some web containers that support JNDI in addition to servlets and JSP) can also provide access to resource factories that produce the objects used in an application, such as a DataSource that produces Connection objects for database access. The <resource-ref> element defines these factories using the <res-ref-name> to specify the JNDI path used in the application, the <res-type> for the factory type, and <res-auth> to define whether the authentication is performed by the application (with the Application value) or the container (with the Container value). An optional <res-sharing-scope> element can be used to define if the objects produced by the factory may be shared or not (with Shareable and Unshareable, respectively, the prior being the default):

<resource-ref>
  <res-ref-name>/jms/Production</res-ref-name>
  <res-ref-type>/javax.sql.DataSource</res-ref-type>
  <res-auth>Container</res-auth>
</resource-ref>

As for most elements, <description> elements can provide descriptions in multiple languages to help the deployer.

Get JavaServer Faces 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.