On 8/17/05, Dave Newton <[EMAIL PROTECTED]> wrote:
> Konrad Billewicz wrote:
> 
> >At the moment I wish to do it using web.xml or, maybe better, context file in
> >conf/Catalina/. Currently there are serveral things to change ie. data source
> >parameters.
> >
> >What do you think about it?
> >
> >
> I think storing it under the Tomcat config directories would be a really
> bad idea, since they're application (not server) level configs.
> 
> Personally, I keep things like this in either web.xml, a struts config
> file, or an application-specific configuration mechanism (generally XML
> or YAML).
> 

There is actually a counter-argument to this that matters a lot in
some environments, where storing application-specific configuration
information externally is the best answer.  In many development
environments, an application gets deployed to at least two
(development and production), and often three (development,
test/staging, and production) different servers, each connected to
different database and other resources, and perhaps configured with
different application specific settings.

Externalizing the configuration into the server settings lets you take
*exactly* the same WAR file and deploy it into each of these
environments, without having to bust it apart and change the
appropriate settings each time.

For Tomcat in particular, I'd encourage you to use the JNDI naming
context mechanisms for defining initialization parameters and data
sources.  More information is at:

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html

> Dave

Craig

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

Reply via email to