2013年1月15日
摘要: 自动装配bean的属性值<bean ...autowire="*".../>autowire的5个参数值byName: name指的是所依赖bean的idbyType:type指的是所依赖bean的class类名constructorautodetect: byType和constructor之间选一no注意:在最外层的bean指定所有bean的autowire默认值 即: <bean...default-autowire="*"/>,默认default-autowire="no" 阅读全文
posted @ 2013-01-15 20:21 Chenyong Liu 阅读(1411) 评论(0) 推荐(0)
摘要: bean的继承例如:<bean id="graduate" parent="student" class="com.lcy.inherit.Graduate">...</bean>对象属性值注入:set方法构造方法自动装配 阅读全文
posted @ 2013-01-15 16:09 Chenyong Liu 阅读(192) 评论(0) 推荐(0)
摘要: bean的生命周期(ApplicationContext)(1)调用构造函数,实例化(2)设置属性值(3)调用BeanNameAware的setBeanName()方法(4)调用BeanFactoryAware的setBeanFactory()方法(5)调用ApplicationContextAware的setApplicationContext()方法(6)调用BeanPostProcessor的预初始化方法(before)(7)调用InitializingBean的afterPropertiesSet()方法(8)调用定制的初始化方法(init-method="myInit&qu 阅读全文
posted @ 2013-01-15 12:45 Chenyong Liu 阅读(158) 评论(0) 推荐(0)