在父上下文中,我的属性声明如下:
<bean id="my.properties"
class="com.rcslabs.webcall.server.property.PropertyPaceholderConfigurer">
<property name="locations" value="classpath:/my.properties"/>
</bean>
之后,在运行时,我需要创建一个子上下文,并用运行时数据覆盖这些属性。最好的方法是什么?
添加:
更准确地说,我在运行时手动创建一个子上下文,如下所示:
ClassPathXmlApplicationContext childAppContext = new ClassPathXmlApplicationContext(parentApplicationContext);
那么,我可以在 childAppContext 中声明一个 bean,就像通常使用 BeanDefinitionRegistry 一样吗?