RE: WAR files and web.xml

2005-04-01 Thread David Owens
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:[EMAIL PROTECTED] 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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



Re: WAR files and web.xml

2005-04-01 Thread Lionel Farbos
For the same needs,
I use the Context.xml outside the war.
use the tags Parameter .../ to pass your admin parameters.
Regards.

On Fri, 1 Apr 2005 08:26:37 -0500
Mark [EMAIL PROTECTED] wrote:

 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: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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