Download multiple property files with <util: properties> in spring 3
I want to upload multiple property files using the <util:properties> in a spring 3 application. I searched on blogs but cannot get the correct path for this.
Hope someone gives me an answer to solve this problem.
+8
Anshul
source share3 answers
My decision
<context:property-placeholder location="classpath*:*.properties,file:/some/other/path/*.properties" /> +9
Piotr gwiazda
source shareIn fact, <util:properties> is just a convenient tag for org.springframework.beans.factory.config.PropertiesFactoryBean . And PropertiesFactoryBean supports multiple locations.
Thus, you can create a bean using Properties as follows:
<bean id="myProps" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="locations"> <list> <value>classpath:myprops-common.properties</value> <value>classpath:myprops-override.properties</value> <value>classpath:some-more-props-here.properties</value> </list> </property> </bean> +13
Alexei Osipov
source shareutil: properties seem to support only 1 property file ( link ). You might want to use the configuration suggested by @peperg.
+3
Aravind R. yarram
source share