共享上下文:spring应用程序中的property-placeholder

时间:2013-02-11 09:54:41

标签: spring

我有一个Spring应用程序,在我的弹簧上下文中不共享资源( property-placeholder )。
我在 web.xml 中定义了 ContextLoaderListener ,并加载了 root-context.xml ,其中定义了 < context:property-placeholder location =“classpath:file.properies”/>
然后我的应用程序中有一个portlet,当我尝试使用 myportlet-context.xml file.properties 中定义的某个属性时,spring不能找到那个价值 我错过了一些事吗?
ContextLoaderListener中定义的资源不是在所有上下文中共享的吗?

1 个答案:

答案 0 :(得分:1)

我认为你必须在调度程序servlet中加载<context:property-placeholder location="classpath:file.properies" /> ..