Skip to content

Instantly share code, notes, and snippets.

@peter-y
Created December 16, 2017 06:57
Show Gist options
  • Save peter-y/4019f5e5ad5c60fd7f549acd147c675f to your computer and use it in GitHub Desktop.
Save peter-y/4019f5e5ad5c60fd7f549acd147c675f to your computer and use it in GitHub Desktop.
父子bean的配置,并且 子bean 会marge 父类设置的同名属性进行合并,覆盖重复的,保留不同的
<beans>
<bean id="parent" abstract="true" class="example.ComplexObject">
<property name="adminEmails">
<props>
<prop key="administrator">administrator@example.com</prop>
<prop key="support">support@example.com</prop>
</props>
</property>
</bean>
<bean id="child" parent="parent">
<property name="adminEmails">
<!-- the merge is specified on the child collection definition -->
<props merge="true">
<prop key="sales">sales@example.com</prop>
<prop key="support">support@example.co.uk</prop>
</props>
</property>
</bean>
<beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment