Aleksei Lekomtsev
Aleksei Lekomtsev

Reputation: 135

How to configure application context in Spring?

I have application context file, which has such strings:

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

Here main.properties is file with dynamic properties. I want change their periodically and so I need store these properties on file system, out of the jar.

How can I configure several paths in application context? Or there is a different way to resolve my issue?

Thanks.

Upvotes: 0

Views: 867

Answers (1)

Steve Oh
Steve Oh

Reputation: 1159

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

Upvotes: 1

Related Questions