【学习底层原理系列】重读spring源码2-入口

上篇介绍了Spring IOC的核心功能,都在refresh()方法里。那么这个方法是从哪发起调用的呢?

web.xml

看如下配置:

  <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath*:config/spring/appcontext-*.xml
        </param-value>
    </context-param>
 
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
ContextLoaderListener,就是最初的入口。
题外:contextConfigLocation是spring的配置文件存放路径。


参考:https://blog.csdn.net/v123411739/article/details/86555733
原文地址:https://www.cnblogs.com/xyang/p/12354585.html