如何在属性文件更改时重新加载Spring4上下文?如何在属性文件更改时重新加载Spring 4上下文
其实我用@Value("$param{myParam}")
和我得到的占位符从我的applicationContext.xml这样的:
<bean id="param-PropertyPlaceholder"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="file:${confdir}/parameters.properties" p:placeholder-prefix="$param{" />
怎么能当我的属性文件改变了我的@Value变化?其实我必须重新启动我的应用程序才能看到更改。
可能的重复http://stackoverflow.com/questions/7599449/springframework-propertyplaceholderconfigurer – aksappy
我不想设置一个计时器来做到这一点。用本地Spring类没有办法做到这一点? –
PropertyPlaceholderConfigurer仅在应用程序启动时加载。 – aksappy