Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 38425 invoked from network); 1 Nov 2008 21:01:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Nov 2008 21:01:38 -0000 Received: (qmail 85040 invoked by uid 500); 1 Nov 2008 21:01:32 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 84563 invoked by uid 500); 1 Nov 2008 21:01:31 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 84552 invoked by uid 99); 1 Nov 2008 21:01:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2008 14:01:31 -0700 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jak-tomcat-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Nov 2008 21:00:16 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KwNaa-000791-F5 for users@tomcat.apache.org; Sat, 01 Nov 2008 21:00:56 +0000 Received: from pool-71-165-239-6.lsanca.dsl-w.verizon.net ([71.165.239.6]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Nov 2008 21:00:56 +0000 Received: from wbarker by pool-71-165-239-6.lsanca.dsl-w.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Nov 2008 21:00:56 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: users@tomcat.apache.org From: "Bill Barker" Subject: Re: Convenient web application configuration. Date: Sat, 1 Nov 2008 14:00:55 -0700 Lines: 56 Message-ID: References: X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pool-71-165-239-6.lsanca.dsl-w.verizon.net X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Original Sender: news X-Virus-Checked: Checked by ClamAV on apache.org "Jason Cipriani" wrote in message news:c09049bf0810300323q3d7df8fcs80c407eefea14472@mail.gmail.com... > I'm using Tomcat 6.0.18 on Windows XP SP3, Windows Server 2003, and > Windows Vista (UAC disabled). > > I have a web application with a lot of configuration options, all > currently stored as servlet initialization parameters in > WEB-INF/web.xml. The parameters are site specific and are different > for my development machine, the machines of the two other developers > working on the project, and the production machine. I am the only > developer working on the web application. > > My problem is that web.xml is part of the web application WAR file. > Also web.xml differs for the 4 different machine the web application > runs on. This means that every single time I make a release, I have to > comment and uncomment blocks of parameters in web.xml, build 4 > separate WAR files customized for each machine, and make the 4 > separate WAR files available to each of the 4 people running the web > application. This is very cumbersome and it seems unreasonably > complicated, and has already led to a number of distribution mistakes > on multiple occasions. Is there a better place I can store > site-specific configuration options? Any suggestions would be helpful. > This is specific to Tomcat, but Tomcat will do System variable replacement while parsing web.xml. So you would do something like: foobar ${myapp.foobar} Then each of the 4 just have to include a -Dmyapp.foobar=value when starting up Tomcat. > Similarly, I have a JDBC data source defined in META-INF/context.xml. > The data source parameters are different for each machine. Is there > some other way I can define data sources so that I don't have to > maintain separate WAR files for each configuration? > > Ideally I'd be able to put the settings in context.xml and web.xml > somewhere outside of the web application directory, and leave them out > of the web-app's local files, and so they wouldn't have to be packaged > with the WAR and deploying the WAR wouldn't blow away existing > configuration data. > > Thanks, > Jason > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org