开发者

Multiple property file

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 = xxx

kestrel.properties:

mediacast.url = xxx

With 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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜