tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: 'Parametrizing' context.xml?
Date Mon, 14 Dec 2009 17:55:54 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ken,

On 12/14/2009 11:50 AM, Ken Bowen wrote:
> You can make use of ant's token filtering on copy.

This is exactly what we do to solve the OP's problem: we have a
revision-controlled context.xml file that has all this replacement stuff
in it. Running 'ant build' creates a user-specific context.xml file by
using properties defined in ~/.ant.properties. Our CVS version looks
like this:

<Context reloadable="true">
   <WatchedResource>WEB-INF/struts-config.xml</WatchedResource>
   <WatchedResource>META-INF/context.xml</WatchedResource>

   <Resource name="@DATASOURCE_REF@"
        description="..."
        auth="Container"
        type="javax.sql.DataSource"
        maxActive="1"
        maxIdle="1"
        maxWait="10000"
        url="@DATABASE_URL@"
        username="@DATABASE_USERNAME@"
        password="@DATABASE_PASSWORD@"
        driverClassName="@DATABASE_DRIVER@"
        removeAbandoned="true"
        removeAbandonedTimeout="30"
        logAbandoned="true"
        testOnBorrow="true"
        validationQuery="/* ping */ SELECT 1"
    />
</Context>

We happen to only use this parametric replacement for our <Resource>,
but you can certainly replace anything you want.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksmfCoACgkQ9CaO5/Lv0PCi8wCgj/WupPuKuUxfP0mLxMM/tRTW
b9sAn314U7NStwtp0b0HucCgqljM5xvT
=4xRC
-----END PGP SIGNATURE-----

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


Mime
View raw message