You don't say what version. I am aware that things are changing in this
area in 5.5.x so what I'm saying possibly applies to 5.0.x only. Check the
docs if you have a different version.
In 5.0.x, you have to put in web.xml if you want to be
compliant with the servlet spec.
If you do that, you do
Ok got it.
If I could read property I would have saved myself a lot of time. Just
to emphasise for anyone else looking at this thread..
> a context (if not
> DefaultContext) can be defined in the server.xml *or*
> conf///.xml
The OR is important - i was defining a context for the same webapp in
Almost, you must define it in a context usually app specific rather than
DefaultContext. The bit that makes it almost is that a context (if not
DefaultContext) can be defined in the server.xml *or*
conf///.xml e.g. /conf/Catalina/localhost/test.xml
If deploying as a WAR to Tomcat you would have
So - I cannot *not* define a resource at the server level (i.e. not
touch the server.xml or any other server configuration file) and only
define it in the app configuration files - i.e. web.xml ?
It seems like thats what you are saying below - just want to be sure I
understand clearly.
Thanks
Hi,
You need both. You define the resource in the context of the app and
then link to the resource from the app.
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html
PJ
Nishant Deshpande wrote:
When I set up a db resource in web.xml and create it, for some reasons
i
When I set up a db resource in web.xml and create it, for some reasons
it has null's in its attributes (such as username, url, driverClass,
..).
But when I set up the same resource in server.xml, it works fine.
>From the documentation it wasn't clear to me if both need to be set up
the same way.