IOC容器实例化 博客分类: spring IOCSpringXML
程序员文章站
2024-03-16 08:00:21
...
方式1: --------------- org.springframework.core.io.Resource resource = new org.springframework.core.io.FileSystemResource( "com/spring/mapping/applicationContext.xml"); org.springframework.beans.factory.BeanFactory beanfactory = new org.springframework.beans.factory.xml.XmlBeanFactory( resource); 方式2: --------------- org.springframework.core.io.ClassPathResource resource=new org.springframework.core.io.ClassPathResource("com/spring/mapping/applicationContext.xml"); org.springframework.beans.factory.BeanFactory beanfactory = new org.springframework.beans.factory.xml.XmlBeanFactory( resource); 方式3: --------------- org.springframework.context.ApplicationContext context=new org.springframework.context.support.ClassPathXmlApplicationContext("com/spring/mapping/applicationContext.xml"); org.springframework.beans.factory.BeanFactory beanfactory=(org.springframework.beans.factory.BeanFactory)context;
推荐阅读
-
IOC容器实例化 博客分类: spring IOCSpringXML
-
Spring3核心技术之IOC控制反转 博客分类: Spring spring3控制反转ioc容器
-
Spring架构揭秘-事件监听机制 博客分类: Spring springjava事件监听IOC容器事件
-
Spring架构揭秘-IOC容器 博客分类: Spring springiocwebjava架构
-
Spring学习(二)---在IoC容器中装配Bean 博客分类: Spring 3.x 企业应用开发笔记 springbeanioc框架
-
Spring IoC浅析 博客分类: Spring Spring容器IoCAOP源码
-
Spring的IoC容器实现原理(一)#loadBeanDefinition 博客分类: Spring SpringIoC
-
Spring源码解读(2)IOC容器bean的实例化