-
-
Save peter-y/4019f5e5ad5c60fd7f549acd147c675f to your computer and use it in GitHub Desktop.
父子bean的配置,并且 子bean 会marge 父类设置的同名属性进行合并,覆盖重复的,保留不同的
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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