web.xml 配置详解

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  
  <display-name>system </display-name>
  
  <context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>esysm.root</param-value>
  </context-param>
  <context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>classpath:log4j.properties</param-value>
  </context-param>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <!-- <param-value>classpath:conf/spring-context.xml, classpath:conf/spring-cache.xml, classpath:conf/spring-task.xml</param-value> -->
    
    <param-value>classpath:conf/spring-context.xml, classpath:conf/spring-cache.xml</param-value>
  </context-param>
  
  <!-- 监听器配置 -->
  <listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  </listener>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  
  <!-- 过滤器配置 -->
  <!-- 字符集过滤 -->
  <filter>
    <filter-name>CharacterEncodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>CharacterEncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  
  
  <!-- 
  <filter>
    <filter-name>HiddenHttpMethodFilter</filter-name>
    <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>HiddenHttpMethodFilter</filter-name>
    <servlet-name>DispatcherServlet</servlet-name>
  </filter-mapping>
   -->
   
   <!-- 登陆过滤 -->
  <filter>
    <filter-name>LoginFilter</filter-name>
    <filter-class>com.wondersgroup.esysm.security.filter.LoginFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>LoginFilter</filter-name>
    <url-pattern>*.do</url-pattern>
  </filter-mapping>
   
   
  <!-- url特殊字符过滤 -->
  <filter>
    <filter-name>XSSFilter</filter-name>
    <filter-class>com.wondersgroup.esysm.core.filter.XSSFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>XSSFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  
  
  
  
  
  <!-- servlet配置 -->
 
  
  <!-- 验证码
  <servlet>
    <servlet-name>CaptchaServlet</servlet-name>
    <servlet-class>com.wondersgroup.esysm.core.servlet.CaptchaServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>CaptchaServlet</servlet-name>
    <url-pattern>/captcha</url-pattern>
  </servlet-mapping>
   -->
  
  <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:conf/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>
  
   <!--  -->
  <servlet>
    <servlet-name>InitServlet</servlet-name>
    <servlet-class>com.wondersgroup.esysm.core.servlet.InitServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>InitServlet</servlet-name>
    <url-pattern>/reload</url-pattern>
  </servlet-mapping>
  
  <!-- 
  <servlet>
    <servlet-name>PollingServlet</servlet-name>
    <servlet-class>com.wondersgroup.esysm.support.servlet.PollingServlet</servlet-class>
    <load-on-startup>5</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>PollingServlet</servlet-name>
    <url-pattern>/polling</url-pattern>
  </servlet-mapping>
   -->
  
  <!-- jsp 标签 -->
  <!-- jstl -->
  <jsp-config>
    <taglib>
      <taglib-uri>http://java.sun.com/jsp/jstl/core_rt</taglib-uri>
      <taglib-location>/WEB-INF/tld/c-rt.tld</taglib-location>
    </taglib>
    <taglib>
      <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
      <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
    </taglib>
    <taglib>
      <taglib-uri>http://java.sun.com/jsp/jstl/functions</taglib-uri>
      <taglib-location>/WEB-INF/tld/fn.tld</taglib-location>
    </taglib>
    <!-- 自定义tools -->
    <taglib>
      <taglib-uri>tools</taglib-uri>
      <taglib-location>/WEB-INF/tld/tools.tld</taglib-location>
    </taglib>
    
    <taglib>
      <taglib-uri>pages</taglib-uri>
      <taglib-location>/WEB-INF/tld/pages.tld</taglib-location>
    </taglib>
  </jsp-config>
  
  <!-- session超时设置 -->
  <session-config>
    <session-timeout>60</session-timeout>
  </session-config>
</web-app>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值