What is resource-ref in web.xml used for?
- by Denise
Hi everyone,
I'm just wondering when/why you would define a resource-ref element in your web.xml file?
I would have thought that it would be defined in your web/app server using JNDI and then look up the JNDI reference in your Java code?
The resource-ref definition seems a bit redundant to me and I can't think of when it might be useful. Example:
<resource-ref>
<description>Primary database</description>
<res-ref-name>jdbc/primaryDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>CONTAINER</res-auth>
</resource-ref>
Thanks!