I've developed one small application which will be used in different area using different database connection. I want to make properties file which will say all the value of *<data-source>* in *struts-config* and put the value in *struts-config* when tomcat starts and that's how we can get the right database connection every time. I'm looking for something like this:[...]
<set-property property="driverClassName" value="$(DRIVERNAME)" />
I do this in the Ant build by filtering the properties file when you build the .war file or copy to the webapps directory.
Here's an example from my build.xml:
<!-- Copy any resource or configuration files -->
<target name="resources">
<filter token="TOMCATHOME" value="${tomcat.home}"/>
<filter token="TESTHOST" value="${test.host}"/>
<filter token="SOAPHOST" value="${soap.host}"/>
<copy todir="WEB-INF/classes" includeEmptyDirs="no" filtering="true">
<fileset dir="WEB-INF/src">
<patternset>
<include name="**/*.conf"/>
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</patternset>
</fileset>
</copy>
</target>
And in the properties file:
# Host name part of SOAP server URL soap.server:@SOAPHOST@
etc.
Mojo -- Morris Jones Monrovia, CA http://www.whiteoaks.com Old Town Astronomers: http://www.otastro.org
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]