ContextLoaderListener是配置在web.xml里的,具体如下:

 <!--
    ContextLoaderListener是个监听器,用来监听容器启动事件,监听到容器启动事件后
    其contextInitialized方法会被调用,在这个方法中,spring会初始化一个启动上下文
    -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

ContextLoaderListener是一个监听器,用来监听容器启动事件,监听到容器启动事件后,会调用其contextInitialized(ServletContextEvent event)方法,该方法负责完成IOC容器在Web环境中的启动工作,负责在容器启动后初始化IOC容器(会调用AbstractApplicationContext.refresh()方法)。

ContextLoaderListener的说明

 

相关文章:

  • 2021-11-05
  • 2022-01-15
  • 2022-01-24
  • 2021-12-28
  • 2021-11-05
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2021-12-17
  • 2021-06-14
  • 2021-10-11
  • 2021-12-27
  • 2021-11-26
  • 2021-08-27
  • 2022-01-06
相关资源
相似解决方案