Spring的servlet context和application context
Spring lets you define multiple contexts in a parent-child hierarchy.
The applicationContext.xml defines the beans for the "root webapp context", i.e. the context associated with the webapp.
The spring-servlet.xml (or whatever else you call it) defines the beans for one servlet's app context. There can be many of these in a webapp, one per Spring
 servlet (e.g. spring1-servlet.xml for servlet spring1, spring2-servlet.xml for servlet spring2).
Beans in spring-servlet.xml can reference beans in applicationContext.xml, but not vice versa.
All Spring MVC controllers must go in the spring-servlet.xml context.
In most simple cases, the applicationContext.xml context is unnecessary. It is generally used to contain beans that are shared between all servlets in
 a webapp. If you only have one servlet, then there's not really much point, unless you have a specific use for it.
另外,servlet context只在servet被init()的时候加载,各servlet的context相互独立,包括URL映射规则什么的都是独立的~~~
Spring的servlet context和application context的更多相关文章
- Android开发之Android Context,上下文(Activity Context, Application Context)
		
转载:http://blog.csdn.net/lmj623565791/article/details/40481055 1.Context概念Context,相信不管是第一天开发Android,还 ...
 - Spring Boot 核心配置文件 bootstrap & application
		
Spring Boot 核心配置文件 bootstrap & application 1.SpringBoot bootstrap配置文件不生效问题 2.bootstrap/ applicat ...
 - interface21 - web - ContextLoaderListener(Spring Web Application Context加载流程)
		
前言 最近打算花点时间好好看看spring的源码,然而现在Spring的源码经过迭代的版本太多了,比较庞大,看起来比较累,所以准备从最初的版本(interface21)开始入手,仅用于学习,理解其设计 ...
 - 【spring mvc】application context的生命周期
		
上一次讲application context中bean的生命周期,后面贴了一部分代码,但根本没理解代码意思,有幸在博客园看到一篇关于这部分的代码解析,特别长,特此做了一些整理笔记,并附上链接:htt ...
 - Spring < context:annotation-config> 、< context:component-scan>、< mvc:annotation-driven />注解配置
		
Spring 中在使用注解(Annotation)会涉及到< context:annotation-config> 和 < context:component-scan>配置, ...
 - [Spring Unit Testing] Spring Unit Testing with a Java Context
		
For example, we want to test against a implemataion: package com.example.in28minutes.basic; import o ...
 - Spring 梳理-Spring配置文件 -<context:annotation-config/>和<context:component-scan base-package=""/>和<mvc:annotation-driven /> 的区别
		
<context:annotation-config/> 在基于主机方式配置Spring时,Spring配置文件applicationContext.xml,你可能会见<contex ...
 - 【异常】The dependencies of some of the beans in the application context form a cycle
		
一.异常出现场景以及异常信息 场景:SpringBoot中自定义DataSource数据源 异常信息: -- :: --- [ main] o.s.b.d.LoggingFailureAnalysis ...
 - Spring 开启Annotation  <context:annotation-config> 和 <context:component-scan>诠释及区别
		
<context:annotation-config> 和 <context:component-scan>的区别 <context:annotation-config& ...
 
随机推荐
- java@ What are C++ features missing in Java
			
Following features of C++ are not there in Java. No pointers No sizeof operator No scope resolution ...
 - Unity3D知识点
			
世界空间(World):整个虚拟世界的3d空间,在Unity3d中以米作为单位,如长100米宽100米高100米的立体空间. 屏幕空间(Screen):屏幕2d空间,大小就是屏幕的大小,以像素作为单位 ...
 - Xcode5和ios7下交叉编译ffmpeg
			
先申明本机环境 dev-mini:ffmpeg devone$ sw_vers ProductName: Mac OS X ProductVersion: BuildVersion: 1 ...
 - elecworks 电缆型号管理器
			
部件的命名:系列 导线数x尺寸 (不含保护类型的电线) 或:系列 导线数G尺寸 G(指保护线颜色gr ...
 - 关于 JavaScript 数据类型判断
			
在 JavaScript 中,有 undefined.null.number.string.boolean 五种基本数据类型,另外,有一种复杂数据类型 object ,类似于 C# 中值类型.引用类型 ...
 - Php AES加密、解密与Java互操作的问题
			
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html 内部邀请码:C8E245J (不写邀请码,没有现金送) 国 ...
 - 模板 lucas
			
void extend_gcd(ll a,ll &x,ll b,ll &y){ ){ x=,y=; return; } ll x1,y1; extend_gcd(b,x1,a%b,y1 ...
 - 微信公众平台java开发详解(工程代码+解析)
			
原文:http://blog.csdn.net/pamchen/article/details/38718947 说明:本次的教程主要是对微信公众平台开发者模式的讲解,网络上很多类似文章,但很多都让初 ...
 - [React Fundamentals] State Basics
			
State is used for properties on a component that will change, versus static properties that are pass ...
 - 5.6 太多分区引起OOM
			
一个月之前,Scott和同事们发现公司有一个MySQL MHA集群的master(假设master机器名为hostA)每隔一周左右就会挂一次(指MySQL挂掉),在几周内,MHA来回切了好几次. 按照 ...