spring 容器

2020-09-04  本文已影响0人  轻云绿原

0:先上图

容器

1:第一个最大的容器ServletContext容器-appllication

2:spring IOC容器-第二大

什么叫bean:由spring管理的java对象

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:applicationContext.xml,classpath:spring-security.xml</param-value>
  </context-param>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

监听org.springframework.web.context.ContextLoaderListener,在这里面加载applicationContext.xml

3:spring的子容器

  <servlet>
    <servlet-name>dispatcherServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:spring-mvc.xml</param-value>
    </init-param>
  </servlet>
上一篇下一篇

猜你喜欢

热点阅读