tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Owens" <David.Ow...@ngt.com>
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 build.properties 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 build.properties.  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 
production.

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

|)ave

-----Original Message-----
From: Mark [mailto:elihusmails@gmail.com] 
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
work?  

Thank you.

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


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


Mime
View raw message