• web.xml的加载过程是context-param >> listener >> fileter >> servlet


    Eclipse  Web项目下的Web.xml文件下的标签加载过程是context-param >> listener >> fileter >> servlet

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                          http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
        version="3.0">
        <welcome-file-list>
            <welcome-file>test.jsp</welcome-file>
        </welcome-file-list>
        <!-- Spring IOC配置 -->
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring/applicationContext.xml</param-value>
        </context-param>
    
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <filter>
        <filter-name>myFilter</filter-name>
        <filter-class>xx.MyFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>myFilter</filter-name>
    <servlet-name>目标资源一</servlet-name>
    </filter-mapping>
    <filter-mapping>
    <filter-name>myFilter</filter-name>
    <servlet-name>目标资源二</servlet-name>
    </filter-mapping> <!-- SpringMVC --> <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/spring-mvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcherServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app>
  • 相关阅读:
    Flume下读取kafka数据后再打把数据输出到kafka,利用拦截器解决topic覆盖问题
    idea 党用快捷键
    Idea 调试快捷键
    log4j实时将数据写入到kafka,Demo和相关的配置详解
    windows环境下,kafka常用命令
    ElasticSearch 基本概念
    elasticsearch REST API方式批量插入数据
    自提柜-资产管理柜
    10.智能快递柜(源码下载)
    9.智能快递柜SDK(串口型锁板)
  • 原文地址:https://www.cnblogs.com/lyxcode/p/10736419.html
Copyright © 2020-2023  润新知