- 浏览: 488410 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (672)
- 随便写写 (3)
- javascript (16)
- Java exam (58)
- JSP exam (25)
- Servlet exam (25)
- Struts exam (24)
- Spring exam (24)
- Hibernate exam (19)
- EJB exam (25)
- SOA exam (6)
- AJAX exam (25)
- Web开发 exam (25)
- 软件工程 exam (25)
- 项目管理 exam (25)
- .NET exam (23)
- ASP.NET exam (24)
- C# exam (24)
- C++ exam (25)
- C语言 exam (13)
- ASP exam (0)
- PHP exam (0)
- Ruby exam (0)
- Python exam (0)
- Delphi exam (0)
- Linux exam (0)
- UNIX exam (25)
- 数据库 exam (24)
- Oracle exam (25)
- SQL Server exam (20)
- MySQL exam (16)
- Mobile开发 exam (10)
- 嵌入式开发 exam (6)
- 网络安全 exam (0)
- 网络技术 exam (0)
- 综合技术 exam (0)
- HR面试 exam (0)
- 英语面试 exam (0)
- 外企面试 exam (0)
- 软件测试 exam (0)
- QTP exam (0)
- LoadRunner exam (0)
- 网友面经 exam (0)
- 应届生 exam (0)
- 面试指导 exam (0)
- IQ测试 exam (0)
- Flex exam (2)
- uml-ea (1)
最新评论
-
dxking100:
远光没有笔式题的说..
最新远光软件笔试题面试题内容(1) -
heming_way:
谢谢,正在复习软件工程考试呢,呵呵
《软件工程》选择题 -
梅玲达:
可以更详细点吗?
Hibernate中Criteria 和DetachedCriteria的作用是什么? -
buptjian:
学习下,试试看,谢谢啊~
Prototype如何实现页面局部定时刷新? -
bubblegum89:
这个。。。和我笔试时候做的 感觉完全不一样
最新远光软件笔试题面试题内容(3)
作用:
1. BeanFactory负责读取bean配置文档,管理bean的加载,实例化,维护bean之间的依赖关系,负责bean的声明周期。
2. ApplicationContext除了提供上述BeanFactory所能提供的功能之外,还提供了更完整的框架功能:
a. 国际化支持
b. 资源访问:Resource rs = ctx. getResource(”classpath:config.properties”), “file:c:/config.properties”
c. 事件传递:通过实现ApplicationContextAware接口
3. 常用的获取ApplicationContext的方法:
FileSystemXmlApplicationContext:从文件系统或者url指定的xml配置文件创建,参数为配置文件名或文件名数组
ClassPathXmlApplicationContext:从classpath的xml配置文件创建,可以从jar包中读取配置文件
WebApplicationContextUtils:从web应用的根目录读取配置文件,需要先在web.xml中配置,可以配置监听器或者servlet来实现
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
这两种方式都默认配置文件为web-inf/applicationContext.xml,也可使用context-param指定配置文件
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/myApplicationContext.xml</param-value>
</context-param>
1. BeanFactory负责读取bean配置文档,管理bean的加载,实例化,维护bean之间的依赖关系,负责bean的声明周期。
2. ApplicationContext除了提供上述BeanFactory所能提供的功能之外,还提供了更完整的框架功能:
a. 国际化支持
b. 资源访问:Resource rs = ctx. getResource(”classpath:config.properties”), “file:c:/config.properties”
c. 事件传递:通过实现ApplicationContextAware接口
3. 常用的获取ApplicationContext的方法:
FileSystemXmlApplicationContext:从文件系统或者url指定的xml配置文件创建,参数为配置文件名或文件名数组
ClassPathXmlApplicationContext:从classpath的xml配置文件创建,可以从jar包中读取配置文件
WebApplicationContextUtils:从web应用的根目录读取配置文件,需要先在web.xml中配置,可以配置监听器或者servlet来实现
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
这两种方式都默认配置文件为web-inf/applicationContext.xml,也可使用context-param指定配置文件
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/myApplicationContext.xml</param-value>
</context-param>
发表评论
-
spring的jdbc与传统的jdbc有什么区别,其核心类有那些?
2010-08-12 16:34 1058Spring的jdbc:节省代码,不管连接(Connectio ... -
spring+hibernate的配置文件中的主要类有那些?如何配置?
2010-08-12 16:34 602在myeclipse中先加入spring环境再加入hibern ... -
解释一下Dependency injection(DI,依赖注入)和IOC(Inversion of control,控制反转)?
2010-08-12 16:34 771参考答案:依赖注入DI是一个程序设计模式和架构模型, 一些时候 ... -
简述你对IoC(Inversion of Control)的理解
2010-08-12 16:34 689一个类需要用到某个接口的方法,我们需要将类A和接口B的实现关联 ... -
如何在spring中实现国际化?
2010-08-12 16:34 475在applicationContext.xml加载一个bea ... -
两种依赖注入的类型都是什么?
2010-08-12 16:34 680两种依赖注入的类型分别是setter注入和构造方法注入。set ... -
Spring里面如何定义hibernate mapping?
2010-08-12 16:34 731添加hibernate mapping 文件到web/WEB- ... -
如何在web环境中配置applicationContext.xml文件?
2010-08-12 16:34 661<listener> <listener- ... -
spring的配置的主要标签是什么?有什么作用?
2010-08-12 16:34 866<beans> <bean id=”” ... -
Spring如何实现事件处理?
2010-08-12 16:34 767事件 Extends ApplicationEvent监听器 ... -
在spring中有几种事务管理,分别是什么?
2010-08-12 16:34 1303代码管理的事务处理TransactonTemplate的exe ... -
Spring对多种ORM框架提供了很好的支持,简单描述在Spring中使用Hibernate的方法。
2010-08-12 16:34 947在context中定义DataSource,创建Session ... -
请介绍一下Spring的事务管理
2010-08-12 16:34 864spring提供了几个关于事务处理的类:Transaction ... -
如何配置spring+struts?
2010-08-12 16:34 305在struts-config.xml加入一个插件,通过它加载a ... -
Spring里面applicationContext.xml文件能不能改成其他文件名?
2010-08-12 16:34 775ContextLoaderListener是一个Servlet ... -
如何在Spring的applicationContext.xml里面使用JNDI而不是datasource?
2010-08-12 16:34 1170可以使用”org.springframework.jndi.J ... -
spring与ejb2.0的事务管理比较的优缺点?
2010-08-12 16:34 1053测试: Spring:pojo Ejb:二个接口一个类 ... -
如何加入Spring到web框架中?
2010-08-12 16:34 666在web.xml中加入如下同容,在启动web服务器时加载/WE ... -
Spring里面如何配置数据库驱动?
2010-08-12 16:34 585使用”org.springframework.jdbc.dat ... -
描述一下Spring中实现DI(Dependency Injection)的几种方式
2010-08-12 16:34 1294方式一:接口注入,在实际中得到了普遍应用,即使在IOC的概念尚 ...
相关推荐
NULL 博文链接:https://364232252.iteye.com/blog/2369489
Spring中ApplicationContext和beanfactory区别.rar
5、BeanFactory 和 ApplicationContext 有什么区别? 6、Spring 有几种配置方式? 7、如何用基于 XML 配置的方式配置 Spring? 8、如何用基于 Java 配置的方式配置 Spring? 9、怎样用注解的方式配置 Spring? 10、...
5、BeanFactory 和 ApplicationContext 有什么区别? 6、Spring 有几种配置方式? 7、如何用基于 XML 配置的方式配置 Spring? 8、如何用基于 Java 配置的方式配置 Spring? 9、怎样用注解的方式配置 Spring? 10、...
一共近百道题与完整答案Spring框架的优点都有什么?...spring 中的BeanFactory与ApplicationContext的作用和区别?Spring如何实现资源管理?如何在web应用里面配置spring?。。。。。。 适合面试、学习、总结与复习.
- BeanFactory和ApplicationContext的区别是什么? - 什么是IOC容器和DI依赖注入? - Spring依赖注入的方式有几种? - 一个bean的定义包含了什么?(BeanDefinition) - bean的作用域有哪些? - Spring 的扩展点主要...
1. 什么是Spring框架?Spring框架有哪些主要模块? 2. 使用Spring框架有什么好处? 3. 什么是控制反转(IOC)?...5. BeanFactory和ApplicationContext有什么区别? 等。。。。。。。。。。。。。。。。
Spring中BeanFactory和ApplicationContext的区别 谈谈Spring IOC的理解,原理与实现? bean的生命周期,详细看上面 SpringBoot自动装配的过程的原理: spring的缓存; spring是如何解决的循环依赖; BeanFactory和...
BeanFactory和ApplicationContext有什么区别 Spring有几种配置方式 如何用基于XML配置的方式配置Spring 如何用基于Java配置的方式配置Spring 怎样用注解的方式配置Spring 请解释Spring Bean的生命周期 Spring Bean的...
Spring有两个核心接口:BeanFactory和ApplicationContext,其中ApplicationContext是BeanFactory的子接口。他们都可代表Spring容器,Spring容器是生成Bean实例的工厂,并且管理容器中的Bean。 Bean是Spring管理的...
(2)BeanFactory与ApplicationContext: ApplicationContext内部封装了BeanFactory,功能更加强大。 加载xml文件使用ClassPathXmlApplicationContext("applicationContext.xml") (3)BeanFactory(bean工厂)与...
53. 在 Spring AOP 中,关注点和横切关注的区别是什么? 54. 连接点 55. 通知 56. 切点 57. 什么是引入? 58. 什么是目标对象? 59. 什么是代理? 60. 有几种不同类型的自动代理? 61. 什么是织入。什么是织入应用...
作者:钱安川(Moxie) 注:后面的内容我将不再完善,但网上的朋友可以帮助完善,只需注明...ApplicationContext 21 Spring的AOP框架 21 Spring的数据层访问 22 Spring的声明式事务 22 Spring对其它企业应用支持 22
Spring 容器:介绍了 Spring 容器的不同类型,包括 BeanFactory 和 ApplicationContext,以及它们在管理对象生命周期和依赖注入方面的作用。 依赖注入:详细解释了依赖注入的原理和用法,以及如何配置和管理 Bean ...
在前面两篇文章中,我们已经对ApplicationContext的大部分内容做了介绍,包括国际化,Spring中的运行环境,Spring中的资源,Spring中的事件监听机制,还剩唯一一个BeanFactory相关的内容没有介绍,这篇文章我们就来...
迷你书是《Spring揭秘》的精选版,节选了原书中介绍Spring IoC容器的6个章节。《Spring揭秘》以幽默生动的语言、辅以有趣的故事和典故,循循善诱地阐述了Spring框架的方方面面。针对Spring框架的主要功能以及开发者...
ApplicationContext 21 Spring的AOP框架 21 Spring的数据层访问 22 Spring的声明式事务 22 Spring对其它企业应用支持 22 注:后面的内容我将不再完善,但网上的朋友可以帮助完善,只需注明住处即可。
搞清楚BeanFactory家族的接口和类的作用 2. 搞清楚ApplicationContext家族的接口和类的作用 3. 搞清楚BeanDefinitionRegistry和SingletonBeanRegistry的作用 4. 搞清楚注册BeanDefinition流程中各个类的作用 5. 搞...
Spring IOC和DI概述,Bean的配置形式,IOC容器BeanFactory和ApplicationContext概述,依赖注入的方式,属性注入,构造器注入等案例
2、使用Spring框架能带来哪些好处 3、什么是控制反转(IOC) 5、BeanFactory和ApplicationContext有什么区别 2、FileS