I have a war file that will be deployed on many clients. I just want to change the configurations on database.properties
file without generating a new build.
Using the code below on my applicationContext.xml
spring configuration file I achieved the expected result from a jar file,
<bean id="propertyConfig" class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:META-INF/spring/*.properties</value>
<value>file:./database.properties</value>
</list>
</property>
<!--If false (default) then config file ("resource") must exist or exception is thrown.
Set to true if the config file is optional-->
<property name="ignoreResourceNotFound" value="true"/>
<!--If false (default) then if placeholder fails to resolve throw exception-->
<property name="ignoreUnresolvablePlaceholders" value="true"/>
</bean>
and now I just want to deploy my war on tomcat7 and let the application search for the external property file with my database settings on the same directory where my .war is deployed, on the client machine without need the full tomcat directory path. like I realized before to the jar.
What I have to do?