<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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_2_5.xsd">
    <display-name>registration</display-name>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <display-name>Archetype Created Web Application</display-name>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:/spring-*.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>servlet-dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:/dispatcher-servlet.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>servlet-dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>


    <filter>
        <filter-name>loginFilter</filter-name>
        <filter-class>org.ccpit.base.security.LoginFilter</filter-class>
        <init-param>
            <param-name>exceptPaths</param-name>
            <param-value>/admin/login</param-value>
        </init-param>
        <init-param>
            <param-name>redirectPath</param-name>
            <param-value>/admin/login</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>loginFilter</filter-name>
        <url-pattern>/admin/*</url-pattern>
        <url-pattern>/business/*</url-pattern>
        <url-pattern>/base/*</url-pattern>
        <url-pattern>/resource/ueditor1_4_2/jsp/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>encodingFilter</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>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <!-- encoding filter for jsp page -->
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
 	<!-- 解决 XSS 漏洞 -->
	<!-- <filter>
		<filter-name>XssEscape</filter-name>
		<filter-class>org.ccpit.base.utils.XSSFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>XssEscape</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
	</filter-mapping> -->

    <!-- Spring 管理hibernate Session-->
    <filter>
        <filter-name>hibernateFilter</filter-name>
        <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>hibernateFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <jsp-config>
        <!--定义标签库-->
        <taglib>
            <!--确定标签库的URI-->
            <taglib-uri>http://www.ccpit.org/</taglib-uri>
            <!-- 确定标签库定义文件的位置 -->
            <taglib-location>/WEB-INF/tld/security.tld</taglib-location>
        </taglib>
    </jsp-config>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>

	 <!-- 错误页面 -->
    <error-page>
        <error-code>400</error-code>
        <location>/error.jsp</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/error.jsp</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/error.jsp</location>
    </error-page>

</web-app>