A typical use-case: I'm having applicationContext.xml
and dispatcher-servlet.xml
. In the parent context (applicationContext.xml
) I have:
<context:property-placeholder location="classpath:application.properties" />
However, the variables loaded by it are not accessible to the web context - neither in xml, nor using @Value
. (They are just not resolved and the variable expression (${varName}
) is set as value instead)
I worked it around by adding the <context:property-placeholder>
to dispatcher-servlet.xml
as well, but I wondered whether:
- This is expected behaviour
- There isn't a better way to expose the variables to the child context.