tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Owens" <>
Subject RE: WAR files and web.xml
Date Fri, 01 Apr 2005 14:20:50 GMT
I'm not sure what kind of information you are trying to change but I
have a few suggestions which might get you started:

1) If the changes are something like database/realm passwords or logging
information, you can put those in a context file called <yourapp>.xml
and put it in $CATALINA_HOME/conf/Catalina/localhost before you
drop your war in place.  (For that matter I guess you could put any sort
of resource or resource reference in there) So the user can modify the
xml file before they run "ant install" and the install target drops the
context file in that dir, and then the war in the webapps dir.  (Or
better yet, the user could modify the before doing the
install and ant could do the configuration/substitution in the context
file as described below.)

2) You could setup tokens like @REPLACE_HERE@ in your web.xml and
then have something like user1.information=A and user2.information=B
etc in your  You could use ant's replace target
to replace the tokens during the war target.  The user (or you) could
then specify the deploy environment like this:
"ant -Ddeploy.env=user1 war"
which would create a war file using the "user1." properties.
We do this where I work to create wars for dev, test, uat, and 

If #2 looks like something you want to do, and you want the
ant snippet, email me and I'll send it your way. :)


-----Original Message-----
From: Mark [] 
Sent: Friday, April 01, 2005 6:27 AM
To: Tomcat Users List
Subject: WAR files and web.xml

I have a question concerning the generation of a war file and my
web.xml file.  I want to create a WAR file for my web application
using Ant, and place my web.xml file into the WAR file.  The problem I
have is that once the web.xml file is placed into the web.xml file,
users/admins will not be able to make changes to the configuration
parameters in the web.xml file.
For instance, I have a servlet that I load at tomcatstartup and it
reads configuration information from the web.xml.  Now if the web.xml
file has to be placed into the WAR file, a customer will not be able
to customize the values contained in the web.xml file.

So, am I missing something, or is this how everything is supposed to

Thank you.

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

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

View raw message