web.xml 5.47 KB
<?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"
	version="3.0">

	<display-name>Runsa Portal Web Application</display-name>

	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath:spring.xml</param-value>
	</context-param>
	<!-- Logback配置路径 -->
	<context-param>
		<param-name>logbackConfigLocation</param-name>
		<param-value>classpath:${profiles.logback}</param-value>
	</context-param>
	<context-param>
		<param-name>class.impl.profile</param-name>
		<param-value>system</param-value>
	</context-param>
	
	<context-param>  
	    <param-name>contextClass</param-name>  
	    <param-value>cn.runsa.crmapp.base.extendsion.spring.CustomXmlWebApplicationContext</param-value>  
	</context-param>
	
	<context-param>
	  	<param-name>webAppRootKey</param-name>
	 	<param-value>portal.root</param-value>
 	</context-param>
 	
 	<listener>
		<listener-class>cn.runsa.portal.web.listener.ServerListener</listener-class>
	</listener>
	
	<listener>
		<listener-class>ch.qos.logback.ext.spring.web.LogbackConfigListener</listener-class>
	</listener>
	
	<listener>
		<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
	</listener>

	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<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>
	</filter>

	<!-- Page EhCache -->
	<filter>
		<filter-name>cacheFilter</filter-name>
		<filter-class>net.sf.ehcache.constructs.web.filter.SimplePageCachingFilter</filter-class>
		<!-- 阻塞超时 <init-param> <param-name>blockingTimeoutMillis</param-name> <param-value>false</param-value> </init-param> -->
		<init-param>
			<!-- 缓存名称 -->
			<param-name>cacheName</param-name>
			<param-value>SimplePageCachingFilter</param-value>
		</init-param>
	</filter>
	<!-- Shiro Security filter -->
	<filter>
		<filter-name>shiroFilter</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>

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

	<!-- 暂时禁用 <filter-mapping> <filter-name>cacheFilter</filter-name> <url-pattern>/dept/findtree.json</url-pattern> </filter-mapping> -->
	<filter-mapping>
		<filter-name>shiroFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<servlet>
		<servlet-name>dynamicQueryServlet</servlet-name>
		<servlet-class>cn.runsa.portal.query.servlet.DynamicQueryServlet</servlet-class>
	</servlet>
	<servlet>
		<servlet-name>captcha</servlet-name>
		<servlet-class>com.google.code.kaptcha.servlet.KaptchaServlet</servlet-class>
		<init-param>
			<param-name>kaptcha.noise.impl</param-name>
			<param-value>com.google.code.kaptcha.impl.NoNoise</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.obscurificator.impl</param-name>
			<param-value>cn.runsa.portal.web.kaptcha.NoGimpy</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.border</param-name>
			<param-value>no</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.background.clear.from</param-name>
			<param-value>255,255,255</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.background.clear.to</param-name>
			<param-value>255,255,255</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.textproducer.char.string</param-name>
			<param-value>123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.textproducer.font.names</param-name>
			<param-value>Tahoma</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.textproducer.font.size</param-name>
			<param-value>30</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.textproducer.font.color</param-name>
			<param-value>248,45,37</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.textproducer.char.length</param-name>
			<param-value>4</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.image.width</param-name>
			<param-value>96</param-value>
		</init-param>
		<init-param>
			<param-name>kaptcha.image.height</param-name>
			<param-value>40</param-value>
		</init-param>
	</servlet>
	<servlet>
		<servlet-name>springMVC</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<init-param>
			<param-name>contextConfigLocation</param-name>
			<param-value>/WEB-INF/spring-mvc.xml</param-value>
		</init-param>
		<init-param>
			<param-name>contextClass</param-name>
			<param-value>cn.runsa.crmapp.base.extendsion.spring.CustomXmlWebApplicationContext</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>dynamicQueryServlet</servlet-name>
		<url-pattern>/query/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>captcha</servlet-name>
		<url-pattern>/captcha.jpg</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>springMVC</servlet-name>
		<url-pattern>/</url-pattern>
	</servlet-mapping>
	<session-config>
		<session-timeout>1440</session-timeout>
	</session-config>
</web-app>