1
votes

I have a Spring application which a resource (property-placeholder) isn't shared across my spring contexts.
I've defined the ContextLoaderListener in my web.xml, and it loads a root-context.xml, where is defined a <context:property-placeholder location="classpath:file.properies" />
Then my application have a portlet in it, and when I try to use some property which is defined in file.properties in the myportlet-context.xml, spring can't find that value.
Have I missed something to do?
Aren't the resources defined from the ContextLoaderListener shared across all the contexts?

1
can you give some more details?AxxA Osiris
I have a very similar problem too. I load properties in the root application context. In the dispatcherservlet's application context, I perform component scanning of a @Controller annotated class whose member String needs to be injected with a property value. However, this works only when I load the properties from the dispatcherservlet's context and does not work when loaded from the root application context. Any reason for this behavior?Web User
I think that the properties aren't inherited in child contextsrascio

1 Answers

1
votes

i think you have to load the <context:property-placeholder location="classpath:file.properies" /> in dispatcher servlet..