Spring源码深度解析——笔记

1.spring容器的基本用法

xml配置

<bean id="myTestBean" class="bean.MyTestBean"/>

调用

BeanFactory bf = new XmlBeanFactory(new ClassPathResource("beanFactoryTest.xml"));
MytestBean bean = (MyTestBean) bf.getBean("myTestBean");

 

posted @ 2017-07-30 17:26  lakeslove  阅读(194)  评论(0编辑  收藏  举报