<?xml version="1.0" encoding="utf-8"?>
|
<web-app 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_3_0.xsd" version="3.0" >
|
|
<display-name>eCoworks</display-name>
|
|
<!--如果不定义webAppRootKey参数,那么webAppRootKey就是缺省的"webapp.root"-->
|
<context-param>
|
<param-name>webAppRootKey</param-name>
|
<param-value>RootPath</param-value>
|
</context-param>
|
|
<!--由Sprng载入的Log4j配置文件位置-->
|
<context-param>
|
<param-name>log4jConfigLocation</param-name>
|
<param-value>classpath:log4j.xml</param-value>
|
</context-param>
|
|
<!--Spring默认刷新Log4j配置文件的间隔,单位为毫秒-->
|
<context-param>
|
<param-name>log4jRefreshInterval</param-name>
|
<param-value>60000</param-value>
|
</context-param>
|
<!--Spring log4j Config loader-->
|
<!-- 监听器 -->
|
<listener>
|
<listener-class>org.apache.logging.log4j.web.Log4jServletContextListener</listener-class>
|
</listener>
|
|
<!-- 指定Spring Bean的配置文件所在目录。默认配置在WEB-INF目录下 -->
|
<context-param>
|
<param-name>contextConfigLocation</param-name>
|
<param-value>classpath*:/applicationContext*.xml,classpath:dataSource/*.xml</param-value>
|
</context-param>
|
<!-- 监听器 -->
|
<listener>
|
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
</listener>
|
<!-- 监听器 -->
|
<listener>
|
<listener-class>com.yc.listener.SessionListener</listener-class>
|
</listener>
|
<listener>
|
<display-name>ImageIO service provider loader/unloader</display-name>
|
<listener-class>com.twelvemonkeys.servlet.image.IIOProviderContextListener</listener-class>
|
</listener>
|
|
<servlet>
|
<servlet-name>initBean</servlet-name>
|
<servlet-class>com.yc.factory.InitBean</servlet-class>
|
<load-on-startup>1</load-on-startup>
|
<async-supported>true</async-supported>
|
</servlet>
|
|
<!-- spring MVC核心 -->
|
<servlet>
|
<servlet-name>annomvc</servlet-name>
|
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
<!-- 默认为WEB-INF目录下,名称为[<servlet-name>]-servlet.xml,如annomvc-servlet.xml -->
|
<load-on-startup>2</load-on-startup>
|
<async-supported>true</async-supported>
|
</servlet>
|
<servlet-mapping>
|
<servlet-name>annomvc</servlet-name>
|
<url-pattern>*.do</url-pattern>
|
</servlet-mapping>
|
<servlet-mapping>
|
<!--APP更新调用接口-->
|
<servlet-name>annomvc</servlet-name>
|
<url-pattern>/v</url-pattern>
|
</servlet-mapping>
|
<servlet-mapping>
|
<!--websocket-->
|
<servlet-name>annomvc</servlet-name>
|
<url-pattern>/websocket</url-pattern>
|
</servlet-mapping>
|
|
<servlet>
|
<servlet-name>jsp</servlet-name>
|
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
|
<async-supported>true</async-supported>
|
<init-param>
|
<param-name>fork</param-name>
|
<param-value>false</param-value>
|
</init-param>
|
<init-param>
|
<param-name>xpoweredBy</param-name>
|
<param-value>false</param-value>
|
</init-param>
|
<init-param>
|
<param-name>mappedfile</param-name>
|
<param-value>false</param-value>
|
</init-param>
|
<load-on-startup>3</load-on-startup>
|
</servlet>
|
|
<!--在向servlet或JSP页面制定初始化参数或定制URL时,必须首先命名servlet或JSP页面。Servlet元素就是用来完成此项任务的-->
|
<!-- 验证码servlet -->
|
<servlet>
|
<servlet-name>imageCode</servlet-name>
|
<servlet-class>com.yc.utils.ImageCode</servlet-class>
|
<async-supported>true</async-supported>
|
</servlet>
|
<!--服务器一般为servlet提供一个缺省的URL:http://host/webAppPrefix/servlet/ServletName。
|
但是,常常会更改这个URL,以便servlet可以访问初始化参数或更容易地处理相对URL。
|
在更改缺省URL时,使用servlet-mapping元素-->
|
<servlet-mapping>
|
<servlet-name>imageCode</servlet-name>
|
<url-pattern>/imageCode</url-pattern>
|
</servlet-mapping>
|
|
<servlet>
|
<servlet-name>FileUpload</servlet-name>
|
<servlet-class>com.yc.servlet.FileUpload</servlet-class>
|
<async-supported>true</async-supported>
|
</servlet>
|
<servlet-mapping>
|
<servlet-name>FileUpload</servlet-name>
|
<url-pattern>/FileUpload</url-pattern>
|
</servlet-mapping>
|
|
<!-- Character Encoding filter -->
|
<!--过滤器元素将一个名字与一个实现javax.servlet.Filter接口的类相关联-->
|
<filter>
|
<filter-name>encodingFilter</filter-name>
|
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
<async-supported>true</async-supported>
|
<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元素把它与一个或多个servlet或JSP页面相关联-->
|
<filter-mapping>
|
<filter-name>encodingFilter</filter-name>
|
<url-pattern>/*</url-pattern>
|
<dispatcher>ASYNC</dispatcher>
|
</filter-mapping>
|
|
<filter>
|
<filter-name>openFilter</filter-name>
|
<filter-class>com.yc.filter.ApiSignFilter</filter-class>
|
<async-supported>true</async-supported>
|
</filter>
|
<filter-mapping>
|
<filter-name>openFilter</filter-name>
|
<url-pattern>/open/*</url-pattern>
|
</filter-mapping>
|
|
<filter>
|
<filter-name>loginFilter</filter-name>
|
<filter-class>com.yc.filter.LoginFilter</filter-class>
|
<async-supported>true</async-supported>
|
</filter>
|
<filter-mapping>
|
<filter-name>loginFilter</filter-name>
|
<url-pattern>*.jsp</url-pattern>
|
</filter-mapping>
|
<filter-mapping>
|
<filter-name>loginFilter</filter-name>
|
<url-pattern>*.do</url-pattern>
|
</filter-mapping>
|
|
<filter>
|
<filter-name>requestParamDecodeFilter</filter-name>
|
<filter-class>com.yc.filter.RequestParamDecodeFilter</filter-class>
|
<async-supported>true</async-supported>
|
</filter>
|
<filter-mapping>
|
<filter-name>requestParamDecodeFilter</filter-name>
|
<url-pattern>*.jsp</url-pattern>
|
</filter-mapping>
|
<filter-mapping>
|
<filter-name>requestParamDecodeFilter</filter-name>
|
<url-pattern>*.do</url-pattern>
|
</filter-mapping>
|
|
<filter>
|
<filter-name>imageFilter</filter-name>
|
<filter-class>com.yc.sdk.shopping.filter.ImageFilter</filter-class>
|
<async-supported>true</async-supported>
|
</filter>
|
<filter-mapping>
|
<filter-name>imageFilter</filter-name>
|
<url-pattern>/uploads/shopping/*</url-pattern>
|
</filter-mapping>
|
<filter-mapping>
|
<filter-name>imageFilter</filter-name>
|
<url-pattern>/uploads/attachment/*</url-pattern>
|
</filter-mapping>
|
|
<filter>
|
<filter-name>formidFilter</filter-name>
|
<filter-class>com.yc.action.build.FormidFilter</filter-class>
|
<async-supported>true</async-supported>
|
</filter>
|
|
<filter>
|
<filter-name>taskFilter</filter-name>
|
<filter-class>com.yc.sdk.shopping.filter.TaskFilter</filter-class>
|
<async-supported>true</async-supported>
|
</filter>
|
|
<!--在返回特定HTTP状态代码时,或者特定类型的异常被抛出时,能够制定将要显示的页面-->
|
<error-page>
|
<error-code>404</error-code>
|
<location>/404.jsp</location>
|
</error-page>
|
|
<error-page>
|
<error-code>500</error-code>
|
<location>/500.jsp</location>
|
</error-page>
|
|
<!--如果某个会话在一定时间内未被访问,服务器可以抛弃它以节省内存。可通过使用HttpSession的setMaxInactiveInterval方法明确设置单个会话对象的超时值,
|
或者可利用session-config元素制定缺省超时值-->
|
<session-config>
|
<session-timeout>120</session-timeout>
|
</session-config>
|
|
<!--指示服务器在收到引用一个目录名而不是文件名的URL时,使用哪个文件-->
|
<welcome-file-list>
|
<welcome-file>default.jsp</welcome-file>
|
<welcome-file>index.jsp</welcome-file>
|
<welcome-file>home.jsp</welcome-file>
|
</welcome-file-list>
|
|
<!-- 是指定该站台是否可分布式处理 -->
|
<distributable/>
|
|
</web-app>
|