zoukankan      html  css  js  c++  java
  • web.xml的启动顺序

    1. context-param

    2. Listener

    3. Filter

    4. servlet

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0" 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">
    	<display-name></display-name>
    
    	<!-- 配置spring用于初始化容器对象的监听器 -->
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>classpath:applicationContext*.xml</param-value>
    	</context-param>
    	<!-- 用于初始化工作的监听器, 一定要配置到spring监听器的后面 -->
    	<listener>
    		<listener-class>cn.itcast.oa.util.InitListener</listener-class>
    	</listener>
    
    	<!-- 配置spring的用于解决懒加载问题的过滤器 -->
    	<filter>
    		<filter-name>OpenSessionInViewFilter</filter-name>
    		<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
    	</filter>
    	<filter-mapping>
    		<filter-name>OpenSessionInViewFilter</filter-name>
    		<url-pattern>*.action</url-pattern>
    	</filter-mapping>
    	<!-- 配置struts2的核心过滤器 -->
    	<filter>
    		<filter-name>struts2</filter-name>
    		<filter-class>
    			org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    		</filter-class>
    	</filter>
    	<filter-mapping>
    		<filter-name>struts2</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    
    	<welcome-file-list>
    		<welcome-file>index.jsp</welcome-file>
    	</welcome-file-list>
    </web-app>
    

      

  • 相关阅读:
    003.同时Ping多个IP(select实现IO复用,信号计时),ping程序升级版
    002.ICMP--拼接ICMP包,实现简单Ping程序(原始套接字)
    001.linux下clock()检测程序运行时间
    django form的函数用法
    命令注入利用语句
    小白审计JACKSON反序列化漏洞
    代码审计小工具
    Burp插件开发--应用篇
    burp插件开发--基础篇
    JAVA web网站代码审计--入门
  • 原文地址:https://www.cnblogs.com/wujixing/p/5604433.html
Copyright © 2011-2022 走看看