zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    10. 正则表达式匹配
    svn 类似.gitignore功能实现
    GF学习未解之谜
    cocos
    unity 编辑器内对Game视图进行截图
    Roughlike游戏里面的随机数种子
    网站推荐——游戏图标网
    Unity 使用image绘制线段 直线
    c# unity 异步任务队列
    Unity编辑器调用外部exe程序 和 windows文件夹
  • 原文地址:https://www.cnblogs.com/lyxcode/p/10736419.html
Copyright © 2011-2022 走看看