Spring loading application.properties based on tomcat servlet contect definition
===

I need to have a development and production settings for our spring project. I understand that you can use profiles for spring but that is not something that we can do.

What I want to do is place on the development environment a test-application.properties file and on production a prod-application.properties file. In the  tomcat context definition we sent the following:

    <Context>
    	<context-param>
    		<param-name>properties_location</param-name>
    		<param-value>file:C:\Users\Bill\test-application.properties</param-value>
    	</context-param>
    </Context>

And we can have the value changed for the production servers. In the spring config we have something like this:

    <bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
    	<property name="locations">
    		<list>
    			<value>${properties_location}</value>
    		</list>
    	</property>
    	<property name="ignoreUnresolvablePlaceholders" value="false" />
    </bean>

But we keep getting errors like:

> org.springframework.beans.factory.BeanInitializationException: Could
> not load properties; nested exception is
> java.io.FileNotFoundException: Could not open ServletContext resource
> [/${properties_location}]

Any ideas on how to solve?

