簡體   English   中英

如何在Spring中配置應用程序上下文?

[英]How to configure application context in Spring?

我有應用程序上下文文件,其中包含以下字符串:

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
            <property name="location">
                <value>main.properties</value>
            </property>
</bean>

這里的main.properties是具有動態屬性的文件。 我想定期更改它們,因此我需要將這些屬性存儲在文件系統中,而不是放在jar中。

如何在應用程序上下文中配置多個路徑? 還是有其他方法可以解決我的問題?

謝謝。

<bean id="placeholderProperties"
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>file:config/main.properties</value>
            <value>file:config/database.properties</value>
        </list>
    </property>
</bean>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM