How to handle multiple property files in spring with placeholderconfigurer?
I have an application context in Common project with following be开发者_JAVA百科an entry:
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:database.properties" />
</bean>
And in Service layer project I have another application context file with this bean entry:
<beans:bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<beans:property name="location" value="classpath:kestrel.properties" />
</beans:bean>
The entries in property file are like :
database proprties: URL= xxx USERNAME = xxx PWD = xxxkestrel.properties:
mediacast.url = xxxWith these setting, when I start my tomcat server I get expection like:
Could not resolve placeholder 'mediacast.url' from kestrel.properties - property file.Thanks in advance for any help!
On my application, I do that:
<bean id="envPropertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>one/path/to/file</value>
<value>another/path/to/file</value>
</list>
</property>
</bean>
精彩评论