web xml

来源:互联网 发布:荷兰GPA算法 编辑:程序博客网 时间:2024/06/10 02:45

 

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
 xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

 <display-name>Struts2</display-name>


<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/applicationContext-web.xml</param-value>
 </context-param>

 

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


 <filter>
  <filter-name>struts2</filter-name>
  <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
 </filter>
 <filter-mapping>
  <filter-name>struts2</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>

 <filter>
  <filter-name>hibernateFilter</filter-name>
  <filter-class>
   org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
 </filter>
 

 

 <session-config>
  <session-timeout>30</session-timeout>
 </session-config>
 <welcome-file-list>
  <welcome-file>/index.jsp</welcome-file>
 </welcome-file-list>

 <error-page>
  <error-code>404</error-code>
  <location>/jsp/error/404.jsp</location>
 </error-page>

 <error-page>
  <error-code>500</error-code>
  <location>/jsp/error/500.jsp</location>
 </error-page>
 
</web-app>