IoC容器 = ApplicationContext
————org.springframework.context
——————-spring-context
容器初始化方式:
1.ApplicationContext x= new ClassPathXmlApplicationContext(“xxx.xml”);
2.ApplicationContext x = new FileSystemXmlApplicationContext(“xxx.xml”);
3.在web项目中用web.xml配置
bean初始化,获取方式:
在spring的xml文件中用<bean>
标签来定义
使用ApplicationContext.getbean()来获取bean对象