Да, вы можете использовать ServletContextParameterFactoryBean
, чтобы выставить context-param
значение (также требуется полная форма PropertyPlaceholderConfigurer
вместо простого context:property-placeholder
):
<bean id = "myLocation" class =
"org.springframework.web.context.support.ServletContextParameterFactoryBean">
<property name="initParamName" value = "myParameter" />
</bean>
<bean class =
"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" ref = "myLocation" />
</bean>
Или используйте EL 3.0 в Spring:
<bean class =
"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value = "#{contextParameters.myParameter}" />
</bean>