I’m currently working on a java application. The application has 3 different properties files. I want to be able to set the name of the properties file based on the name of the server the app is running on.
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:/config/InfSit.properties</value>
</list>
</property>
</bean>
This is from my application-config.xml and currently works fine. I want to be able to change the name of the properties file based on the server the application is running on. So “InfSit.properties” would be “Inf${Env}.properties” (or something along these lines) – But I need a way to pass in the ${Env} parameter (could even be a string from another class). Can anyone suggest the best way to do this?
Thanks.
Set system property in java args
and it will replace ${env} in location expr