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的更多相关文章

  1. spring context上下文(应用上下文webApplicationContext)(转载)

    (此文转载:http://www.cnblogs.com/brolanda/p/4265597.html) 一.先说ServletContext javaee标准规定了,servlet容器需要在应用项 ...

  2. Spring context:component-scan中使用context:include-filter和context:exclude-filter

    Spring context:component-scan中使用context:include-filter和context:exclude-filter XML: <?xml version= ...

  3. Spring context:component-scan代替context:annotation-config

    Spring context:component-scan代替context:annotation-config XML: <?xml version="1.0" encod ...

  4. spring BeanFactory及ApplicationContext中Bean的生命周期

    spring bean 的生命周期 spring BeanFactory及ApplicationContext在读取配置文件后.实例化bean前后.设置bean的属性前后这些点都可以通过实现接口添加我 ...

  5. spring中获取applicationContext

    常用的5种获取spring 中bean的方式总结: 方法一:在初始化时保存ApplicationContext对象代码:ApplicationContext ac = new FileSystemXm ...

  6. Spring的配置文件ApplicationContext.xml配置头文件解析

    Spring的配置文件ApplicationContext.xml配置头文件解析 原创 2016年12月16日 14:22:43 标签: spring配置文件 5446 spring中的applica ...

  7. 使用web.xml方式加载Spring时,获取Spring context的两种方式

    使用web.xml方式加载Spring时,获取Spring context的两种方式: 1.servlet方式加载时: [web.xml] <servlet> <servlet-na ...

  8. 【转】 spring context解惑

    转自:http://blog.csdn.net/c289054531/article/details/9196149?utm_source=tuicool&utm_medium=referra ...

  9. 【报错】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 ...

随机推荐

  1. jquery遍历总结(转)

    遍历 DOM jQuery 提供了多种遍历 DOM 的方法. 遍历方法中最大的种类是树遍历(tree-traversal). 下一章会讲解如何在 DOM 树中向上.下以及同级移动. 向上遍历 DOM ...

  2. jquery.cookie中的操作之与换肤

    jquery.cookie.js的插件,插件的源代码如下: /** * Cookie plugin * * Copyright (c) 2006 Klaus Hartl (stilbuero.de) ...

  3. Vivado Logic Analyzer的使用

    chipscope中,通常有两种方法设置需要捕获的信号.1.添加cdc文件,然后在网表中寻找并添加信号2.添加ICON.ILA和VIO的IP Core 第一种方法,代码的修改量小,适当的保留设计的层级 ...

  4. springboot+springAOP实现数据库读写分离及数据库同步(MySQL)----最新可用2019-2-14

    原文:https://blog.csdn.net/wsbgmofo/article/details/79260896 1,数据源配置文件,如下 datasource.readSize=1spring. ...

  5. C# 使用IP端口网络打印图片

    /// <summary> /// POSPrinter的摘要说明. /// 此类处理网络打印,使用了IP端口. /// </summary> public class Net ...

  6. 李洪强iOS开发之iOS好文章收集

    李洪强iOS开发之iOS好文章收集 该文收集朋友们转发或自己的写的技术文章,如果你也有相关的好文章,欢迎留言,当好文章多的时候,我会对这些好文章进行分门别类 文章 简述 日期 直播服务配置 使用 ng ...

  7. CCNA2.0笔记_IP连接排错

    IPv4 路由排错 ping tracert traceroute telnet show mac address-table show interfaces fastEthernet 0/1 sho ...

  8. c# 常用操作保留

    RanDom如何提高生成随机数的随机性 一个在线考试系统的项目,需要从题库中随机抽取试题,但是如果直接 Random ran=new Randon(),ran.Next(nummin,nummax); ...

  9. DHCP中继器

    DHCP客户机和服务器在不同的子网内,客户机向服务器申请IP地址,这就要用到DHCP中继代理.DHCP中继代理实际上是一种软件技术,安装了DHCP中继代理的计算机称为DHCP中继代理服务器,它承担不同 ...

  10. file相关的操作,(md5,word转html,复制,删除等)

    package cn.edu.hbcf.common.utils; import java.io.BufferedOutputStream; import java.io.ByteArrayOutpu ...