2
有沒有辦法在文件系統上(而不是在類路徑上)引用相對於Spring上下文文件本身的屬性文件?在Spring中指定相對於上下文XML的位置
我想要做的就是下面的:
<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>
我想象像${contextpath}
,我可以預先考慮到上述的「app.properties」,但找不到任何幫助。
謝謝。
你爲什麼不把路徑上的屬性文件,並與您的Spring應用程序得到它。這是一樣的權利?您可以動態更改您的屬性文件內容值。 – 2010-05-22 23:21:32