学习Spring(一) 实例化Spring IoC容器

实例化Spring IoC容器

1,读取其配置来创建bean实例

2,然后从Spring IoC容器中得到可用的bean实例

 

Spring提供两种IoC容器实现类型

a,一种为bean工厂

b,应用程序上下文

应用程序上下文提供了bean工厂更高级的特性

 

实例化应用程序上下文

ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");

 

posted @ 2013-11-26 14:52  梦见舟  阅读(137)  评论(0)    收藏  举报