Specifying Locations relative to the context XML in Spring

Posted by Daisuke Shimamoto on Stack Overflow See other posts from Stack Overflow or by Daisuke Shimamoto
Published on 2010-04-07T09:12:09Z Indexed on 2010/04/07 9:33 UTC
Read the original article Hit count: 130

Filed under:
|

Is there a way to reference a properties file relative to the Spring's context file itself?

What I want to do is the below:

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <!-- I want the below to be relative to this context XML file. -->
            <value>app.properties</value>
        </list>
    </property>
</bean>

I was imagining something like ${contextpath} that I could prepend to the above "app.properties" but couldn't find anything helpful.

Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about spring