ResourceLink is the Tomcat's way of doing JNDI, so
if you port your app on some other server, the deployer
will not even know what is wrong if you do not have
that entry in your web.xml, because this is the only thing
that gets to be moved around (server.xml is not)

Looks a bit redundant but it is there for protability.
I do not see any other reasons for it being there otherwise.

Alex.

> -----Original Message-----
> From: Sasha Borodin [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 13, 2003 5:15 PM
> To: Tomcat Users List
> Subject: Declaring resources - web.xml vs. server.xml
>
>
> I've Googled and read the documentation without producing a definitive
> answer to this question: exactly what IS the purpose of declaring
> resources
> in web.xml?
>
> OK, I've got a GlobalNamingResource set up:
>
>     <Resource auth="Container" name="jdbc/DataTrac" scope="Shareable"
>         type="javax.sql.DataSource"/>
>
>     <ResourceParams name="jdbc/DataTrac">
>         ... All of my parameters ...
>     </ResourceParams>
>
> Then I've got a ResourceLink in my Context definition:
>
>     <ResourceLink global="jdbc/DataTrac" name="jdbc/DataTrac"
>         type="javax.sql.DataSource"/>
>
> ----------------
>
> Now, Tomcat documentation states that I also need the following in my
> web.xml file:
>
>     <resource-ref>
>         <res-ref-name>jdbc/DataTrac</res-ref-name>
>         <res-type>javax.sql.DataSource</res-type>
>         <res-auth>Container</res-auth>
>     </resource-ref>
>
> Why???  Everything works WITHOUT this entry.  And everything works WITH it
> as well.  So my question, again, is what is the purpose of declaring
> resources in web.xml - to (for some reason) complement the resource
> definitions in server.xml, to replace them, or what?
>
> Thank you for your help.
>
> -Sasha Borodin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to