<bean class="Test.Person" id="person01">
<!-- 引用外部的car -->
<property name="myCar" ref="car"></property>
<!-- 级联属性赋值,更改了车的名字,也会改变外部名字 -->
<property name="myCar.carName" value="奔驰"></property>
</bean>
<bean class="Test.Person" id="person02" parent="person01">
<!-- 配置信息继承自其parent,也就是person01,如果需要更改,在用property赋值即可 -->
<property name="name" value="张三"></property>
</bean>
Spring学习之实验六:通过继承实现bean配置信息的重用
原创
©著作权归作者所有:来自51CTO博客作者满眼星星的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
junit继承spring配置信息
[html] view plain copypackage com.baizhi.test;import java.
sheet junit test 测试 单元 -
spring (学习记录)通过factorybean配置bean
之gleton() //是否...
spring xml ide -
spring (学习记录)通过注解配置bean
组件是根据实际情况来配置的。比如一个类,是做业务处理的,那就用@ser
spring xml main函数 -
Spring学习之实验十四:SPEL测试
SPEL(Spring Experssion Language)Spring表达式
spring xml 静态方法 -
jQuery EasyUI 应用
jQuery EasyUI 布局 – 为网页创建边框布局 由 keray2002 创建,Carrie 最后一次修改 2015-09-20 jQuery EasyUI 布局 - 为网页创建边框布局本节将描述如何通过jQuery EasyUI为网页创建边框布局。边框布局(border layout)包含了五个区域,分别是:eas
jQuery EasyUI 应用 javascript ViewUI jQuery 标签页