Spring的ContextLoaderListener加载上下文的源码分析

Spring深度解析-17、ContextLoaderListener初始化上下文全过程 初始化过程简述 由ContextLoaderListener初始化的上下文称之为根上下文,ContextLoaderListener实现了ServletContextListener接口, ServletContextListener监听ServletContextEvnet事件,当ServletContext发生变化则触发ServletContextEvnet事件,比如tomcat启动时,就会触... 阅读详情

前言:

1,如果使用自定义的监听器,需要经过下面的步骤 1到步骤10

2,如果使用Spring自己的监听器ContextLoaderListener,需要经过下面的步骤6到步骤10

3,web.xml中的加载顺序:context-param -> listener -> filter -> servlet

 

上下文加载步骤分析:

1,在WebService的 web.xml可以定义一个监听器:WebContextLoaderListener:

<listener>
    <listener-class>com.dangdang.ddframe.web.WebContextLoaderListener</listener-class>
</listener>

WebContextLoaderListener类:

package com.dangdang.ddframe.web;

public final class WebContextLoaderListener extends ContextLoaderListener {

   
    private static ContainerInitializer containerInitializer = ContainerInitializer.getInstance();

   

    @Override

    public void contextInitialized(final ServletContextEvent event) {

        containerInitializer.startContainer(new AbstractInitializeCallbackAdapter() {

           

            @Override

            public ApplicationContext doInitialize() {

                ServletContext servletContext = event.getServletContext();

                servletContext.setInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, SpringContainer.CONFIG_FILE);

                WebContextLoaderListener.super.contextInitialized(event);

                return WebApplicationContextUtils.getWebApplicationContext(servletContext);

            }

        });

    }

}

ContainerInitializer在初始化时,初始化了参数加载器,读取了日志级别。

2,因为WebContextLoaderListener继承了Spring的ContextLoaderListener类,ContextLoaderListener类是在容器启动时加载spring配置信息用的,web容器启动时,会加载contextInitialized()方法,在这里加载的就是WebContextLoaderListener类的contextInitialized()方法。

3,contextInitialized()方法调用了ContainerInitializer的startContainer()方法,参数是一个AbstractInitializeCallbackAdapter类,先看一下这个AbstractInitializeCallbackAdapter类:

package com.dangdang.ddframe.container.spring.initialize;

public abstract class AbstractInitializeCallbackAdapter implements InitializeCallback {

   

    @Override

    public void logSuccess(final Logger log) {

        log.info("--- dd-frame container started success. ---");

    }

   

    @Override

    public void logFailure(final Logger log, final SystemException cause) {

        log.error("--- dd-frame init failure. ---", cause);

    }

}

其实就是定义了启动成功时候的日志和启动失败时候的日志,他实现的接口InitializeCallback定义了这两个方法,还有启动容器的doInitialize()方法。

4,现在开始看ContainerInitializer的startContainer()方法:

package com.dangdang.ddframe.container.spring.initialize;

    public void startContainer(final InitializeCallback initializeCallback) {

        prepareSystemProperties();

        ApplicationContext context = null;

        try {

            context = initializeCallback.doInitialize();

        // CHECKSTYLE:OFF

        } catch (final Exception ex) {

        // CHECKSTYLE:ON

            logAndThrow(initializeCallback, ex);

        }

        for (Entry<String, InitializeValidator> entry : context.getBeansOfType(InitializeValidator.class).entrySet()) {

            try {

                entry.getValue().validate();

            } catch (final InitializeValidatorException ex) {

                logAndThrow(initializeCallback, ex);

            }

        }

        ContextHolder.initInstance(context);

        initializeCallback.logSuccess(LOG);

       LOG_CONFIG.setLevel(CLASSPATH_PROP_LOADER.getClasspathProperties().getProperty(LogConfig.RUNNING_LOG_LEVEL_KEY));

}

 

5,prepareSystemProperties();方法是把配置文件中的配置项放到java.lang.System中。

然后调用了InitializeCallback的doInitialize()方法,就是在WebContextLoaderListener之中写的那一部分:

@Override

public ApplicationContext doInitialize() {

    ServletContext servletContext = event.getServletContext();

    servletContext.setInitParameter(ContextLoader.CONFIG_LOCATION_PARAM,SpringContainer.CONFIG_FILE);

    WebContextLoaderListener.super.contextInitialized(event);

    return WebApplicationContextUtils.getWebApplicationContext(servletContext);

}

首先设置了配置文件路径:把ContextLoader.CONFIG_LOCATION_PARAM设置为SpringContainer.CONFIG_FILE,这个路径是可配置的,这里配置为:"classpath:META-INF/dd-frame/spring/root/applicationContext.xml"。

然后,在这个方法中调用了父类的contextInitialized()方法,也就是org.springframework.web.context .ContextLoaderListener的contextInitialized()方法:

public void contextInitialized(ServletContextEvent event) {

         initWebApplicationContext(event.getServletContext());

}

6,其中调用的initWebApplicationContext()方法在他的父类org.springframework.web.context.ContextLoader中:

package org.springframework.web.context;

public WebApplicationContext initWebApplicationContext(ServletContext servletContext) {

                   if (servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE) != null) {

                            throw new IllegalStateException(

                                               "Cannot initialize context because there is already a root application context present - " +

                                               "check whether you have multiple ContextLoader* definitions in your web.xml!");

                   }



                   Log logger = LogFactory.getLog(ContextLoader.class);

                   servletContext.log("Initializing Spring root WebApplicationContext");

                   if (logger.isInfoEnabled()) {

                            logger.info("Root WebApplicationContext: initialization started");

                   }

                   long startTime = System.currentTimeMillis();



                   try {

                            // Store context in local instance variable, to guarantee that

                            // it is available on ServletContext shutdown.

                            if (this.context == null) {

                                     this.context = createWebApplicationContext(servletContext);

                            }

                            if (this.context instanceof ConfigurableWebApplicationContext) {

                                     ConfigurableWebApplicationContext cwac = (ConfigurableWebApplicationContext) this.context;

                                     if (!cwac.isActive()) {

                                               // The context has not yet been refreshed -> provide services such as

                                               // setting the parent context, setting the application context id, etc

                                               if (cwac.getParent() == null) {

                                                        // The context instance was injected without an explicit parent ->

                                                        // determine parent for root web application context, if any.

                                                        ApplicationContext parent = loadParentContext(servletContext);

                                                        cwac.setParent(parent);

                                               }

                                               configureAndRefreshWebApplicationContext(cwac, servletContext);

                                     }

                            }

                            servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, this.context);



                            ClassLoader ccl = Thread.currentThread().getContextClassLoader();

                            if (ccl == ContextLoader.class.getClassLoader()) {

                                     currentContext = this.context;

                            }

                            else if (ccl != null) {

                                     currentContextPerThread.put(ccl, this.context);

                            }



                            if (logger.isDebugEnabled()) {

                                     logger.debug("Published root WebApplicationContext as ServletContext attribute with name [" +

                                                        WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE + "]");

                            }

                            if (logger.isInfoEnabled()) {

                                     long elapsedTime = System.currentTimeMillis() - startTime;

                                     logger.info("Root WebApplicationContext: initialization completed in " + elapsedTime + " ms");

                            }



                            return this.context;

                   }

                   catch (RuntimeException ex) {

                            logger.error("Context initialization failed", ex);

                            servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ex);

                            throw ex;

                   }

                   catch (Error err) {

                            logger.error("Context initialization failed", err);

                            servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, err);

                            throw err;

                   }

         }

7,这个方法就是把spring配置文件中的内容加载到上下文的方法,初始化时this.context为null,调用createWebApplicationContext()方法:

         protected WebApplicationContext createWebApplicationContext(ServletContext sc) {

                   Class<?> contextClass = determineContextClass(sc);

                   if (!ConfigurableWebApplicationContext.class.isAssignableFrom(contextClass)) {

                            throw new ApplicationContextException("Custom context class [" + contextClass.getName() +

                                               "] is not of type [" + ConfigurableWebApplicationContext.class.getName() + "]");

                   }

                   return (ConfigurableWebApplicationContext) BeanUtils.instantiateClass(contextClass);

         }

8,方法的第一行调用determineContextClass()方法,返回了ConfigurableWebApplicationContext的Class类,这个方法有很多层,看到最后是调用了ContextLoader.properties配置文件,这个配置文件在Spring的包中是和ContextLoader.class文件放在一起的,没有开放给用户使用,不可配置,这个配置文件内容如下:

# Default WebApplicationContext implementation class for ContextLoader.

# Used as fallback when no explicit context implementation has been specified as context-param.

# Not meant to be customized by application developers.



org.springframework.web.context.WebApplicationContext=org.springframework.web.context.support.XmlWebApplicationContext

如果去掉注释,就一行,代表这里spring的上下文实际上默认是用XmlWebApplicationContext来初始化的。注释里也写了,没打算开放给开发人员去配置。

9,回头看步骤7,在得到Class类后,最后一行调用BeanUtils.instantiateClass()方法进行初始化,并返回。

10,继续看步骤6中的代码,在刚才调用createWebApplicationContext()方法得到对象后,调用configureAndRefreshWebApplicationContext()方法来加载上下文配置:
 

protected void configureAndRefreshWebApplicationContext(ConfigurableWebApplicationContext wac, ServletContext sc) {
          if (ObjectUtils.identityToString(wac).equals(wac.getId())) {
                   // The application context id is still set to its original default value
                   // -> assign a more useful id based on available information
                   String idParam = sc.getInitParameter(CONTEXT_ID_PARAM);
                   if (idParam != null) {
                            wac.setId(idParam);
                   }
                   else {
                            // Generate default id...
                            wac.setId(ConfigurableWebApplicationContext.APPLICATION_CONTEXT_ID_PREFIX +
                                               ObjectUtils.getDisplayString(sc.getContextPath()));
                   }
          }

          wac.setServletContext(sc);
          String configLocationParam = sc.getInitParameter(CONFIG_LOCATION_PARAM);
          if (configLocationParam != null) {
                   wac.setConfigLocation(configLocationParam);
          }

          // The wac environment's #initPropertySources will be called in any case when the context
          // is refreshed; do it eagerly here to ensure servlet property sources are in place for
          // use in any post-processing or initialization that occurs below prior to #refresh
          ConfigurableEnvironment env = wac.getEnvironment();
          if (env instanceof ConfigurableWebEnvironment) {
                   ((ConfigurableWebEnvironment) env).initPropertySources(sc, null);
          }

          customizeContext(sc, wac);
          wac.refresh();
}

11,代码最后的refresh()方法,实际调用的是之前初始化的XmlWebApplicationContext的refresh()方法,这个方法的实现在他的祖辈中,这个类的继承关系是:

org.springframework.web.context.support.XmlWebApplicationContext

继承

org.springframework.web.context.support.AbstractRefreshableWebApplicationContext

继承

org.springframework.context.support.AbstractRefreshableConfigApplicationContext

继承

org.springframework.context.support.AbstractRefreshableApplicationContext

继承

org.springframework.context.support.AbstractApplicationContext

refresh()方法在AbstractApplicationContext类中:

public void refresh() throws BeansException, IllegalStateException {
          synchronized (this.startupShutdownMonitor) {
                   // Prepare this context for refreshing.
                   prepareRefresh();

                   // Tell the subclass to refresh the internal bean factory.
                   ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();

                   // Prepare the bean factory for use in this context.
                   prepareBeanFactory(beanFactory);

                   try {
                            // Allows post-processing of the bean factory in context subclasses.
                            postProcessBeanFactory(beanFactory);

                            // Invoke factory processors registered as beans in the context.
                            invokeBeanFactoryPostProcessors(beanFactory);

                            // Register bean processors that intercept bean creation.
                            registerBeanPostProcessors(beanFactory);

                            // Initialize message source for this context.
                            initMessageSource();

                            // Initialize event multicaster for this context.
                            initApplicationEventMulticaster();

                            // Initialize other special beans in specific context subclasses.
                            onRefresh();

                            // Check for listener beans and register them.
                            registerListeners();

                            // Instantiate all remaining (non-lazy-init) singletons.
                            finishBeanFactoryInitialization(beanFactory);

                            // Last step: publish corresponding event.
                            finishRefresh();
                   }

                   catch (BeansException ex) {
                            logger.warn("Exception encountered during context initialization - cancelling refresh attempt", ex);

                            // Destroy already created singletons to avoid dangling resources.
                            destroyBeans();

                            // Reset 'active' flag.
                            cancelRefresh(ex);

                            // Propagate exception to caller.
                            throw ex;
                   }
          }
}

可以看到refresh()方法初始化了一个BeanFactory,这个方法进行了一系列对BeanFactory的初始化和装配工作,每个子方法里都进行了大量的操作,直到finishBeanFactoryInitialization()方法,初始化了所有非懒加载的单例bean的实例。

 

至此spring的上下文加载完成。

 

 

 

 

用友BIP培训资料-设计采购订单新增API接口开发 14.在子实体的String pkMeas = order_hhrSlave0VOJson.getString("pk_meas");Openapi路径:nccloud/api/pu/order_hhrmanage/order_hhrMaster/addAggOrder_hhrMasterVO。实现接口的开发部署,通过openAPI的test类,实现一条数据的插入。16.进入自己的Idea打开老师发的TestOpenApi并且编译完成后如下。12.编写检测是否字段中是否含有中文的方法。 阅读详情

相关推荐

用友U8 API开发实战:手把手教你使用API资源管理器完成单据操作

本文详细介绍了用友U8 API开发实战,重点讲解如何使用API资源管理器完成采购订单、销售出库单等核心业务单据的全生命周期管理。从开发环境搭建到单据查询、新增、修改、删除等基础操作,再到高级功能如审核状态管理、业务事件处理和自定义项扩展,帮助开发者快速掌握用友U8接口开发技巧,提升企业数字化转型效率。

weixin_28607671的博客 603

Spring集成web环境之获取应用上下文

1.ApplicationContext应用上下文获取方式(了解) 应用上下文对象通过new ClassPathXmlApplicationContext(“spring配置文件”)方式获取的,每次从容器中获得Bean时都要编写new ClassPathXmlApplicationContext(“spring配置文件”),需要配置文件加载多次,应用上下文对象创建多次。在Web项目中,可以使用ServletContextListener监听Web应用的启动,就可以在Web应用启动时,就加载Spring的配置

Victoria_45的博客 532

AutoCAD矢量数据导出全攻略:GIS4CAD插件一键转shp/mdb/kml(附安装包)

本文详细介绍了GIS4CAD插件如何高效解决AutoCAD矢量数据向GIS格式转换的难题。通过一键操作,用户可将CAD中的规划图、地形图等无损转换为行业标准的shp、mdb、kml等多种格式,并确保属性完整与坐标准确。文章提供了从插件安装、数据准备到实战导出的全流程指南,是城市规划、测绘等领域专业人士提升数据互操作效率的必备攻略。

a2b3c4d5e的博客 307

java之ClassLoader

一.java程序的运行流程 ①编译器编译java程序(.java文件)成字节码(.class文件);②加载字节码;③JVM执行字节码成JVM指令;④JVM指令翻译成OS指令;⑤OS指令执行。 其中第一步是编译器的工作,编译器把 .java文件编译成 .class文件,其中 .class文件又称为字节码文件。第二步到第四步都是JVM的工作。在第二步时JVM中有一个加载系统来加载字节码。第三步时J

夜聆离殇的博客 295

保姆级教程:用Docker Compose一键部署WVP-PRO+ZLM+录像服务(含Nginx反代)

本文提供了一套完整的容器化GB28181视频平台部署方案,通过Docker Compose实现WVP-PRO、ZLMediaKit(ZLM)和录像服务的一键式部署。详细介绍了环境准备、架构设计、容器化部署实战以及高级配置优化,帮助用户快速搭建高性能视频监控管理平台,适用于安防行业和物联网设备管理场景。

weixin_30415113的博客 868

lighttools用透镜旋转手动创建菲尼尔透镜

学过很多软件,都没有留下痕迹,很多年之后只记得学过的软件常用的一些功能,稍微难一些的再次用起需要重新学,但如果留下点痕迹,重新再用就会很快。lighttools无意之中接触了,记一点点笔记吧。...

kingsai2012的博客 4341

SpringBoot 学习系列四(SpringMVC中ContextLoaderListener)

Spring MVC 是建立在 IOC 容器基础上的,那么该容器是如何在 Web 环境中被载入并起作用的 ?通常我们需要配置一个监听器(ContextLoaderListener)。 所谓ContextLoaderListener,就是在web部署描述符即web.xml里面经常配置的一个监听器,如下 <listener> <listener-class>org....

jcsyl_mshot的博客 2179

从FedAvg到实战:手把手教你用PyTorch复现联邦学习经典论文实验(MNIST/CIFAR-10)

本文详细介绍了如何使用PyTorch复现联邦学习经典算法FedAvg在MNIST和CIFAR-10数据集上的实验。从环境搭建、数据非IID划分到模型实现和参数聚合,手把手教你掌握联邦学习的核心技术与实战技巧,帮助开发者和研究人员快速实现隐私保护的分布式机器学习方案。

weixin_29053695的博客 264

SpringBoot——SpringBoot配置原理

本博文主要介绍SpringBoot配置原理。帮助大家更好的理解SpringBoot自动配置。通过分析相关源码,实现对SpringBoot自动装配原理有一个更深的理解。更好的应对面试问题。

庄小焱 747

AIGC实战——多模态模型DALL.E 2

DALL.E 2 是 OpenAI 提出的一个大规模文本生成图像模型,可以根据文本提示生成各种风格的逼真图像。它通过将预训练模型 CLIP 与 GLIDE 中的扩散模型架构相结合完成任务。它还具有其他应用,例如通过文本提示编辑图像和提供给定图像的变体。虽然它也有一些局限性,例如不一致的文本渲染和属性绑定,但 DALL.E 2 是仍然一个非常强大的AI模型,推动了生成模型的发展。

盼小辉丶的博客 1万+

Trae IDE项目开发全流程深度技巧与最佳实践

2026年AI开发新范式:Trae AI IDE深度解析 摘要 2026年,AI已成为软件开发的核心驱动力。字节跳动推出的AI原生IDE——Trae,从根本上重塑了开发体验,将AI作为第一公民而非附加功能。Trae通过深度集成大型语言模型和创新交互模式,解决了现代开发中的重复劳动、信息过载等核心痛点。 报告全面剖析了Trae的核心功能: 智能代码生成:支持上下文感知续写、自然语言驱动生成和多模态输入转换 对话式AI助手:提供侧边栏和行内对话模式,支持代码解释、Bug修复、重构建议等 Builder/SOLO

公众号:AI前沿侦探 170

Spring框架学习【Web环境中Spring的启动过程】

1.Spring不但可以在JavaSE环境中应用,在Web环境中也可以广泛应用,Spring在web环境中应用时,需要在应用的web.xml文件中添加如下的配置: [xhtml] view plaincopyprint? ……        contextConfigLocation            /WEB-INF/applicationContext.xml   

zhixiang2010的专栏 2042

如何获取不同分区模板的基因表达矩阵,abagen: Allen 大脑图谱遗传数据工具箱的使用笔记

基因表达从根本上塑造了人类大脑的结构和功能结构。像Allen人脑图谱这样的开放获取转录组数据集提供了前所未有的能力来检查这些机制。abagen工具箱,这是一个用于处理转录组学数据的开放获取软件包,并使用它来检查方法可变性如何影响使用Allen人脑图谱的研究结果。

从事脑科学核磁共振方法学研究,在Nature communications等权威期刊发表研究论文,熟练掌握磁共振处理方法和统计学方法,欢迎大家和我交流。 3350

Web环境中Spring的启动过程

背景: 小白最近在搭建spring框架时,碰到一个词:spring上下文,完全一头雾水,搜了2个小时的资料后,迷迷糊糊的狭隘的认为:spring上下文就是spring的配置文件:applicationContext.xml,当然这其中也涉及了web容器启动的过程,在csdn碰到下文的大神的源码分析,真是不醉都不行啊~ --------------------------------------

lansesl2008的专栏 719

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

Spring MVC源码分析(二):Spring容器的加载

概述

源码之下,了无秘密 1万+

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

【Spring】浅谈ContextLoaderListener及其上下文与DispatcherServlet的区别

一般在使用SpingMVC开发的项目中,一般都会在web.xml文件中配置ContextLoaderListener监听器,如下: <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listene...

fengbin2005的专栏 204

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

ContextLoaderListener的源码分析

ContextLoaderListener的源码分析 ​ 本篇是截取我的这篇文章:ServletContext,WebApplicationContext、Servlet初始化 ​ 首先,我们从web.xml中开始,在web.xml中我们首先配置的是contextLoaderListener,它的作用就是启动web容器时,自动装配ApplicationContext的配置信息。因为它实现了Serv...

qq_38238296的博客 520

Spring 通篇源码 之 启动 之 ContextLoaderListener源码分析

欢迎大家关注本博,同时欢迎大家评论交流,可以给个赞哦!!! Spring 通篇源码 基于 spring-framework-4.1.7.RELEASE 版本。   ContextLoaderListener 源码   ContextLoaderListener类实现很简单,主要针对ServletContextListener做了实现,详细的解析请查看下面代码部分注释。 package org.springframework.web.context; import javax.servlet.Ser.

键盘上流淌的日子 3954

springmvc从入门到源码分析专题2_tomcat服务启动过程中如何加载ContextLoaderListener的

返回专题目录 springmvc从入门到源码分析专题2_tomcat服务启动过程中如何加载ContextLoaderListener的 前言 在上一篇文章中我们做了相关前期准备,并且搭建好了我们的项目环境,成功运行了我们第一个springmvc项目helloword,但是我们并没有对我们的配置文件中的配置进行详解和分析,本篇文章及后面的文章我们将分析讲解这些配置的作用,并深入到源码讲解这些配置是如何实现的 ServletContext的作用 这里首先来说一下ServletContext的作用,因为它对后

u013328649的博客 323

Spring源码分析(一):从哪里开始看spring源码(系列文章基于Spring5.0)

概述

源码之下,了无秘密 17万+

源码分析之Spring MVC上下文的加载细节(一)

题记: 为了解SpringMVC加载过程的细节,最近阅读了其部分源码,并自己手写实现了一个简单的SpringMVC框架,现记录作为总结。 分为三篇博客: • 源码分析之Spring MVC上下文的加载细节(一)【本篇】 • 源码分析之Spring MVC上下文的加载细节(二) • 源码分析之动手实现手写一个自己的SpringMVC框架(三) 阅读完这三篇博客,将了解到: • Sp...

honhong1024的博客 1512

【spring】源码分析 一 从ContextLoaderListener开始·

https://blog.csdn.net/lihuapiao/article/details/51919283 源码环...

311

【Spring】从源码分析Spring配置文件的加载

从源码角度详解Spring配置文件的加载

LZGS_4的专栏 1718

Spring中ContextLoaderListener的作用

Spring中ContextLoaderListener的作用

m0_73533108的博客 168

Spring源码分析【3】-SpingWebInitializer的加载

public class SpingWebInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { @Override protected Class[] getRootConfigClasses() { return new Class[]{RootConfig.clas

编程的本质是数学问题 2617

监听器及ContextLoaderListener源码分析

一、概念 监听器主要功能是对监听对象的监听事件作出相应的触发事件 二、监听器分类 八个监听器,三类监听器 在xml中配置 <listener> <listener-class>com.jd.listener.MyServletContextLisenter</listener-class> </l...

qq_43469862的博客 232
上一篇: Java中double转BigDecimal的注意事项
下一篇: Servlet中几个监听器Listener的使用实例
lkforce
博客等级 码龄17年 399粉丝 167原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值