tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <billwbar...@verizon.net>
Subject Re: 'Parametrizing' context.xml?
Date Tue, 15 Dec 2009 01:29:16 GMT

"Mario Splivalo" <mario.splivalo@megafon.hr> wrote in message 
news:4B266622.5060806@megafon.hr...
> Is there a way to 'parametrize' context.xml, for instance, in a manner
> one can 'parametrize' build.xml?
>
> For some webapplication in context.xml one puts, for instance, JDBC
> specific stuff. But, several developers can have different 'properties'
> for the database (different user accounts, and so on).
>
> Is there a way to parametrize those somehow, or each developer need to
> have separate context.xml?
>
> Mike

Tomcat also supports ant-style variable replacement, so using that then 
Ken's example would look like:
  <context-param>
     <param-name>baseprefix</param-name>
     <param-value>${BPVAL}</param-value>
  </context-param>

where BPVAL is a Java system property (that can be set in 
catalina.properties for example).

Of course, this only works for Tomcat.  Ken's suggestion will work on any 
servlet container. 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message