码迷,mamicode.com
首页 > 编程语言 > 详细

Spring中获取Bean的几种方式

时间:2017-06-29 11:25:24      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:text   rabl   方法   实例化   上下文   启动   获取   ati   config   

ApplicationContext 的主要实现类:
  1.ClassPathXmlApplicationContext:从 类路径下加载配置文件
  2.FileSystemXmlApplicationContext: 从文件系统中加载配置文件
  3.ConfigurableApplicationContext 扩展于 ApplicationContext,新增加两个主要方法:refresh() 和 close(), 让 ApplicationContext 具有启动、刷新和关闭上下文的能力
  4.ApplicationContext 在初始化上下文时就实例化所有单例的 Bean

Spring中获取Bean的几种方式

标签:text   rabl   方法   实例化   上下文   启动   获取   ati   config   

原文地址:http://www.cnblogs.com/xushirong/p/7093034.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!