Hi,
Hoping someone might be able to assist. I've got a property file as an environment variable called ENV that's external to my application. I'm able to load that property file no problem at all.
I'd like to reference another seperate properties file whose path is contained in the ENV propertiesCode:<bean id="applicationProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreUnresolvablePlaceholders" value="false"/> <property name="order" value="1"/> <property name="locations"> <list> <value>file:${ENV}</value> </list> </property> </bean>
e.g.
However I'm having an issue trying to load this second file successfully - the values within it don't seem to be being picked up. I've triedCode:different.properties=C:\location\different.properties
and (based on http://blog.springsource.com/2011/02...-management/):Code:<bean id="differentProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>file:${different.properties}</value> </list> </property> </bean>
I'm clearly doing something wrong but not sure what - any help would be appreciated.Code:<context:property-placeholder location="${different.properties}"/>
Edit
The following code does not work either - get a (The system cannot find the file specified)
Code:<bean id="applicationProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>file:${ENV}</value> <value>file:${different.properties}</value> </list> </property> </bean>


Reply With Quote
