tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Defining JNDI DataSource...why decl'd/def'd in server.xml and not in web.xml.
Date Thu, 30 Oct 2003 13:23:11 GMT
> Why can't I describe the JNDI DataSource in the web.xml of my web 
> application? I didn't notice this possibility in dtd for web.xml.

That's because the application developers and server deployment team 
might be different people. It's much more natural to have the JNDI 
resources setup by those who manage the server itself. The container is 
the one providing the services. The application simply uses them.

> I
> still had to hand-edit server.xml to describe its connection to database 
> and it was done in a context only applying to juddi web app. This seems 
> error-prone and just not clean/modular.

I would argue that it is actually more modular.

It also allows protection for the server. If applications were allowed 
to make arbitrary connections (which they actually still can, using 
Sockets, etc.) then it might make the server unstable. The container 
should be handling resource management, hence the JNDI resources are 
defined and provided by the container.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message