Spring Context及ApplicationContext
web.xml
这是声明了一个父工厂
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/conf/*.xml</param-value>
</context-param>
servlet
这是声明了一个子工厂
<servlet>
<servlet-name>SpringMVC</servlet-name>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-mvc.xml</param-value>
</init-param>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>0</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>SpringMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping> 子工厂可以引用父工厂中的bean 通过实现
org.springframework.context.ApplicationContextAware的
setApplicationContext(ApplicationContext applicationContext)方法可以通过applicationContext的
getBeanDefinitionNames()获得所有的bean。
getParent()获得context的父context。
Spring Context及ApplicationContext的更多相关文章
- spring context上下文(应用上下文webApplicationContext)(转载)
(此文转载:http://www.cnblogs.com/brolanda/p/4265597.html) 一.先说ServletContext javaee标准规定了,servlet容器需要在应用项 ...
- Spring context:component-scan中使用context:include-filter和context:exclude-filter
Spring context:component-scan中使用context:include-filter和context:exclude-filter XML: <?xml version= ...
- Spring context:component-scan代替context:annotation-config
Spring context:component-scan代替context:annotation-config XML: <?xml version="1.0" encod ...
- spring BeanFactory及ApplicationContext中Bean的生命周期
spring bean 的生命周期 spring BeanFactory及ApplicationContext在读取配置文件后.实例化bean前后.设置bean的属性前后这些点都可以通过实现接口添加我 ...
- spring中获取applicationContext
常用的5种获取spring 中bean的方式总结: 方法一:在初始化时保存ApplicationContext对象代码:ApplicationContext ac = new FileSystemXm ...
- Spring的配置文件ApplicationContext.xml配置头文件解析
Spring的配置文件ApplicationContext.xml配置头文件解析 原创 2016年12月16日 14:22:43 标签: spring配置文件 5446 spring中的applica ...
- 使用web.xml方式加载Spring时,获取Spring context的两种方式
使用web.xml方式加载Spring时,获取Spring context的两种方式: 1.servlet方式加载时: [web.xml] <servlet> <servlet-na ...
- 【转】 spring context解惑
转自:http://blog.csdn.net/c289054531/article/details/9196149?utm_source=tuicool&utm_medium=referra ...
- 【报错】spring整合activeMQ,pom.xml文件缺架包,启动报错:Caused by: java.lang.ClassNotFoundException: org.apache.xbean.spring.context.v2.XBeanNamespaceHandler
spring版本:4.3.13 ActiveMq版本:5.15 ======================================================== spring整合act ...
随机推荐
- 【iOS开发-33】学习手动内存管理临时抛弃ARC以及retain/assign知识——iOSproject师面试必考内容
我们为什么须要内存管理?当使用内存达到40M和45M时候会发出警告,假设不处理,占用内存达到120M时直接强制关闭程序. 所以出现闪退除了是程序出现逻辑错误,还有可能是内存使用过大. (1)创建一个对 ...
- .net 非阻塞事件获取返回异步回调结果
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- python得到今天前的七天每天日期
import datetime d = datetime.datetime.now() def day_get(d): # 通过for 循环得到天数,如果想得到两周的时间,只需要把8改成15就可以了. ...
- 多线程-ConcurrentHashMap(JDK1.8)
前言 HashMap非线程安全的,HashTable是线程安全的,所有涉及到多线程操作的都加上了synchronized关键字来锁住整个table,这就意味着所有的线程都在竞争一把锁,在多线程的环境下 ...
- tensolrflow之基础变量
#优化一个乘法算子 #coding:utf- __author__ = 'similarface' import tensorflow as tf sess=tf.Session() #创建一个常量张 ...
- font-sqirrel
html5之前,只要稍微特殊点的字体,都必须做成图片,以免客户端无法显示.而对于正文或者需要后台调用大量文字的地方,则无能为力.但是,html5推出了 @font-face 支持自定义字体之后,这个问 ...
- Jquery学习笔记(6)--jquery中attr和prop的区别【精辟】
jquery中attr和prop的区别 在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别?这些问题就出现了. 关于它们两个的区别,网上的答案很 ...
- H4CK1T CTF 2016 Mexico-Remote pentest writeup
进去网站之后发现连接都是包含类型的,就能想到文件包含漏洞(话说刚总结过就能遇到这题,也算是复习啦) 这里用php://filter/read=convert.base64-encode/resourc ...
- Prerender Application Level Middleware - ASP.NET HttpModule
In the previous post Use Prerender to improve AngularJS SEO, I have explained different solutions at ...
- pl/sql 实例解析 01
1. 合并 firstname, lastname. 1: declare 2: v_first_name varchar2(255); 3: v_last_name varchar2(255); 4 ...