kentaury
Mar 7th, 2006, 08:34 AM
Hi there!
Can somebody help me how can I override the properties of beans set up in a bean xml configuration?
I have more beans with Properties objects, and I'd like to override the values contained in these Properties objects as follows:
<bean id="mybean" class="...">
<property name="mappings">
<props>
<prop key="key1">value1</prop>
<prop key="key2">value2</prop>
</props>
</property>
</bean>
And override these with a property file containing the following:
mybean.mappings:key1=value11
mybean.mappings:key2=value22
I used PropertyOverrideConfigurer, but unfortunatelly it simply creates a new Properties instance on each property definition in the properties file, causing that only the last definition remains after the container starts. So in my example I only have the key2=value22 in the myBean.mappings Properties object.
Thank you,
Balazs Szekely
Can somebody help me how can I override the properties of beans set up in a bean xml configuration?
I have more beans with Properties objects, and I'd like to override the values contained in these Properties objects as follows:
<bean id="mybean" class="...">
<property name="mappings">
<props>
<prop key="key1">value1</prop>
<prop key="key2">value2</prop>
</props>
</property>
</bean>
And override these with a property file containing the following:
mybean.mappings:key1=value11
mybean.mappings:key2=value22
I used PropertyOverrideConfigurer, but unfortunatelly it simply creates a new Properties instance on each property definition in the properties file, causing that only the last definition remains after the container starts. So in my example I only have the key2=value22 in the myBean.mappings Properties object.
Thank you,
Balazs Szekely