You can make use of ant's token filtering on copy.
You identify the parameters in your context.xml, and create a separate
new context.xml with
those parameters identified. For example, we have several such
parameters occurring
in our web.xml, such as @BPVAL@ below:
........
<context-param>
<param-name>baseprefix</param-name>
<param-value>@BPVAL@</param-value>
</context-param>
.........
You store the parameterized context.xml in some separate location in
your tree
(we use WEB-INF/param_src). Then for each of your users, you create
an ant task which copies
the parameterized source file to the "real" source file, supplying the
parameter values to use
for that particular user's task:
<target name="kens_root_setup">
<copy file="${param.src}/web.xml" tofile="${web.inf}/web.xml"
overwrite="true" >
<filterset>
<filter token="BPVAL" value="/" />
</filterset>
</copy>
The only gotcha is that when you have to make modifications to such a
file, you must
remember to make the mods in the parameterized source file (in $
{param.src} ), not to
the "real" file it maps to.
--Ken
On Dec 14, 2009, at 11:21 AM, Mario Splivalo wrote:
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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org