<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
	<display-name>Archetype Created Web Application</display-name>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath*:applicationContext.xml</param-value>
	</context-param>
	
	<context-param>  
	    <param-name>webAppRootKey</param-name>  
	    <param-value>webApp.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>log4jRefreshInterval</param-name>
		<param-value>10000</param-value>
	</context-param>

	<context-param>
		<param-name>spring.profiles.active</param-name>
		<param-value>test</param-value>
	</context-param> 

	<filter>
		<filter-name>etagFilter</filter-name>
		<filter-class>org.springframework.web.filter.ShallowEtagHeaderFilter</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>
		<filter-name>CORSFilter</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>
	<filter>
        <filter-name>loginFilter</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
	<filter-mapping>
		<filter-name>etagFilter</filter-name>
		<servlet-name>rest</servlet-name>
	</filter-mapping>
	<!-- 跨域拦截 START -->
	
	<filter-mapping>
	    <filter-name>CORSFilter</filter-name>
	    <url-pattern>/*</url-pattern>
	</filter-mapping>
	<!-- 跨域拦截 END -->
	
	<!-- 登陆过滤器代理 START -->
    <filter-mapping>
        <filter-name>loginFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!-- 登陆过滤器代理 END -->
    
	<listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
	</listener>
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>	
		
	<servlet>
		<servlet-name>rest</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<init-param>
			<param-name>contextConfigLocation</param-name>
			<param-value>/WEB-INF/rest-servlet.xml</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>rest</servlet-name>
		<url-pattern>/*</url-pattern>
	</servlet-mapping>	
</web-app>
