tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bas Schulte <>
Subject Configuring one webapp in 2 instances, system properties
Date Thu, 29 May 2008 19:04:08 GMT

I'd like to deploy my Spring-based webapp twice in the same Tomcat  
instance, one for production and one for development.

To configure my webapp, these distinct environments connect to  
different database schema using different username/password combo's.

My spring configuration gets this from system properties, like this:

	<bean id="someDataSource"  
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
		<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
		<property name="url" value="jdbc:mysql://$ 

Is there a way to set these properties in server.xml for both  
instance of my webapp? I plan on using 2 virtual hosts, something  
like and, each would get it's own set  
of system properties.

I already tried using environment entries, like this:

<Context ...>
   <Environment name="sh.database.schema" value="shproduction"  
type="java.lang.String" override="false"/>

However, these aren't picked up by Spring.

How would I do this?



To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message