spring是一个控制反转和面向切面的容器框架
控制反转IOC:程序本身不负责对象的创建,由外部容器创建维护,依赖注入是其中的一个实现形式
bean的容器:beanfactory提供结构和基本功能,加载初始化bean。Context保存bean对象。
Web一般用ContextLoaderListener或者ContextLoaderServlet获得context
ApplicationContext context = new FileSystemXmlApplicationContext("classpath*:spring-ioc.xml");//获得上下文
InjectionService oneInterface = (InjectionService) context.getBean("injectionService");//从上下文中获得bean
bean设置注入:就是将bean的方法属性进行初始化
<bean id="injectionService" class="In