<!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>appName</param-name>
		<param-value>yidu-Novel</param-value>
	</context-param>

	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>/WEB-INF/classes/spring/spring.xml</param-value>
	</context-param>
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<context-param>
		<param-name>log4jConfigLocation</param-name>
		<param-value>/WEB-INF/classes/log4j.properties</param-value>
	</context-param>

	<listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
	</listener>

	<listener>
		<listener-class>org.yidu.novel.init.InitializerListener</listener-class>
	</listener>

	<filter>
		<filter-name>struts2</filter-name>
		<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
		<init-param>
			<param-name>actionPackages</param-name>
			<param-value>org.yidu.novel.action</param-value>
		</init-param>
	</filter>

	<filter>
		<filter-name>UrlRewriteFilter</filter-name>
		<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
		<init-param>
			<param-name>confReloadCheckInterval</param-name>
			<param-value>60</param-value>
		</init-param>
		<init-param>
			<param-name>statusEnabledOnHosts</param-name>
			<param-value>*</param-value>
		</init-param>
		<init-param>
			<param-name>logLevel</param-name>
			<param-value>log4j</param-value>
		</init-param>
		<init-param>
			<param-name>statusEnabled</param-name>
			<param-value>false</param-value>
		</init-param>
		<!--<init-param> <param-name>confPath</param-name> <param-value>/WEB-INF/urlrewrite_default.xml</param-value> </init-param> 
			<init-param> <param-name>statusEnabledOnHosts</param-name> <param-value>localhost, *.kaixinwx.com</param-value> </init-param> -->
	</filter>

	<filter>
		<filter-name>GZIPEncoding</filter-name>
		<filter-class>org.yidu.novel.filter.GzipFilter</filter-class>
	</filter>

	<filter>
		<filter-name>poweredByFilter</filter-name>
		<filter-class>org.yidu.novel.filter.PoweredByFilter</filter-class>
	</filter>

	<filter>
		<filter-name>singleBookFilter</filter-name>
		<filter-class>org.yidu.novel.filter.SingleBookFilter</filter-class>
	</filter>


    <filter>
        <filter-name>forbidFilter</filter-name>
        <filter-class>org.yidu.novel.filter.ForbidFilter</filter-class>
    </filter>	

	<!-- The Filter-Mapping Setting -->
    <filter-mapping>
        <filter-name>forbidFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

	<filter-mapping>
		<filter-name>singleBookFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
		<filter-name>poweredByFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
		<filter-name>GZIPEncoding</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
		<filter-name>UrlRewriteFilter</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>ERROR</dispatcher>
	</filter-mapping>

	<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
		<dispatcher>ERROR</dispatcher>
	</filter-mapping>

	<error-page>
		<error-code>404</error-code>
		<location>/error/error404.html</location>
	</error-page>

</web-app>
