• spring context的层次关系


    一、ServletContext

    Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file.

    全局的context,包含springcontext、dispatchservlet、filter、lisener等;

    在tomcat扫描应用时创建。

    二、spring context

    WebApplicationContext

    包含spring中配置的运行所需的所有全局环境变量。

    contextLoaderListener时创建。

    三、dispatch context

    包含处理事务所需的环境变量。

    被dispatcherservlet所持有,引用spring context以查找全局的环境变量。

    applicationContext AnnotationConfigServletWebServerApplicationContext  (id=95)

    FrameworkServlet

    @Override

    public void setApplicationContext(ApplicationContext applicationContext) {

    if (this.webApplicationContext == null && applicationContext instanceof WebApplicationContext) {

    this.webApplicationContext = (WebApplicationContext) applicationContext;

    this.webApplicationContextInjected = true;

    }

    }

  • 相关阅读:
    Apache TomEE 入门指南
    Windows 7运行命令大全
    hibernate hql 大全
    maven常用命令
    php编译安装php-5.6
    nginx编译安装
    apache通过AD验证
    apache编译安装 httpd 2.2 httpd 2.4
    DC 辅域转主域
    tomcat安装配置
  • 原文地址:https://www.cnblogs.com/feng9exe/p/12124996.html
Copyright © 2020-2023  润新知