首页 > 编程语言 > 详细

Spring的web容器的启动

时间:2015-11-09 01:35:42      阅读:255      评论:0      收藏:0      [点我收藏+]

Spring mvc 集成了Spring ioc。在Spring mvc中有一个自己的ServletContext的WebApplicationContext容器其父容器是Spring中有ApplicationContext容器。也就是说

ServletContext的WebApplicationContext容器有自己的上下文,并且能获取全局上下文的对象。WebApplicationContext的容器的都管理了Spring mvc 的Controllers等对象。
Spring mvc启动其实就是SPring MVC容器的创建。Spring mvc容器创建的过程依赖于Servlet容器的生命周期。在Servlet容器的生命周期中的ServletContextListener中来触发。这个可以从Web.xml的配置看出来

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/application.xml</param-value>
    </context-param>
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

WebApplicationContext在ContextLoaderListerner的创建时序图如下.

技术分享

 

Spring的web容器的启动

原文:http://www.cnblogs.com/kejian/p/4948804.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!