<?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"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	id="WebApp_ID" version="3.0">
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.jpg</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.gif</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.png</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.js</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.css</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.woff</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.woff2</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>default</servlet-name>
		<url-pattern>*.ico</url-pattern>
	</servlet-mapping>

	<context-param>
		<param-name>webAppRootKey</param-name>
		<param-value>aidea</param-value>
	</context-param>
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			classpath:applicationContext*.xml
			<!--classpath:applicationContext-shiro.xml-->
			<!--        classpath:dubbo-consumer.xml     classpath*:webservice.xml -->
		</param-value>
	</context-param>
	<!--  移动端JWT 过滤器 -->
	<filter>
		<filter-name>jwtSecurityFilter</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>jwtSecurityFilter</filter-name>
		<url-pattern>/mobile/auth/*</url-pattern>
	</filter-mapping>

	<!--  CSRF PC端过滤器 -->
	<filter>
		<filter-name>springSecurityFilterChain</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>springSecurityFilterChain</filter-name>
		<url-pattern>/page/*</url-pattern>
		<url-pattern>/a/*</url-pattern>
	</filter-mapping>

	<!--  XSS 过滤器,移动端与PC端 -->
	<filter>
		<filter-name>manageSecurityFilter</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>manageSecurityFilter</filter-name>
		<url-pattern>/a/*</url-pattern>
		<url-pattern>/page/*</url-pattern>
		<url-pattern>/mobile/auth/*</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>
	<filter-mapping>
		<filter-name>encodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<filter>
		<filter-name>shiroFilter</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
		<async-supported>true</async-supported>
		<init-param>
			<param-name>targetFilterLifecycle</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>shiroFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<context-param>
		<param-name>log4jConfigLocation</param-name>
		<param-value>classpath:log4j.properties</param-value>
	</context-param>
	<context-param>
		<param-name>log4jRefreshInterval</param-name>
		<param-value>60000</param-value>
	</context-param>
	<listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
	</listener>
	<servlet>
		<servlet-name>dispatcher</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<init-param>
			<param-name>contextConfigLocation</param-name>
			<param-value>classpath:spring-mvc.xml</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>dispatcher</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>


	<!--<servlet>-->
		<!--<servlet-name>JavaScriptServlet</servlet-name>-->
		<!--<servlet-class>-->
			<!--org.owasp.csrfguard.servlet.JavaScriptServlet-->
		<!--</servlet-class>-->
		<!--<init-param>-->
			<!--<param-name>source-file</param-name>-->
			<!--<param-value>WEB-INF/Owasp.CsrfGuard.js</param-value>-->
		<!--</init-param>-->
		<!--<init-param>-->
			<!--<param-name>inject-into-forms</param-name>-->
			<!--<param-value>true</param-value>-->
		<!--</init-param>-->
		<!--<init-param>-->
			<!--<param-name>inject-into-attributes</param-name>-->
			<!--<param-value>true</param-value>-->
		<!--</init-param>-->
		<!--<init-param>-->
			<!--<param-name>domain-strict</param-name>-->
			<!--<param-value>true</param-value>-->
		<!--</init-param>-->
		<!--<init-param>-->
			<!--<param-name>referer-pattern</param-name>-->
			<!--<param-value>http://localhost.*</param-value>-->
		<!--</init-param>-->
		<!--<init-param>-->
			<!--<param-name>x-requested-with</param-name>-->
			<!--<param-value>OWASP CSRFGuard Project</param-value>-->
		<!--</init-param>-->
	<!--</servlet>-->

	<!--<servlet-mapping>-->
		<!--<servlet-name>JavaScriptServlet</servlet-name>-->
		<!--<url-pattern>/JavaScriptServlet</url-pattern>-->
	<!--</servlet-mapping>-->

	<servlet>
		<servlet-name>DruidStatView</servlet-name>
		<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
		<init-param>
			<param-name>allow</param-name>
			<param-value>127.0.0.1</param-value>
		</init-param>
	</servlet>
	<servlet-mapping>
		<servlet-name>DruidStatView</servlet-name>
		<url-pattern>/druid/*</url-pattern>
	</servlet-mapping>
	<!-- <filter>
		<filter-name>mobileFilter</filter-name>
		<filter-class>com.cftechMobileFilterlter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>mobileFilter</filter-name>
		<url-pattern>/static/*</url-pattern>
	</filter-mapping> -->
<!-- 	<servlet> -->
<!-- 		<servlet-name>ws</servlet-name> -->
<!-- 		<servlet-class>org.apache.cxf.trasport.servlet.CXFServlet</servlet-class> -->
<!-- 		<load-on-startup>2</load-on-startup> -->
<!-- 	</servlet> -->
	
<!-- 	<servlet-mapping> -->
<!-- 		<servlet-name>ws</servlet-name> -->
<!-- 		<url-pattern>/ws/**</url-pattern> -->
<!-- 	</servlet-mapping> -->

	<session-config>
		<cookie-config>
			<!--<secure>true</secure>-->
			<http-only>true</http-only>
		</cookie-config>
		<!--<tracking-mode>COOKIE</tracking-mode>-->
	</session-config>

	<welcome-file-list>
		<welcome-file>a/index</welcome-file>
	</welcome-file-list>
	<error-page>
		<error-code>404</error-code>
		<location>/page/404</location>
	</error-page>
	<error-page>
		<error-code>500</error-code>
		<location>/page/500</location>
	</error-page>
	<error-page>
		<exception-type>org.apache.shiro.authz.AuthorizationException</exception-type>
		<location>/page/401</location>
	</error-page>
</web-app>