1.<?xml version="1.0" encoding="UTF-8"?>
2.<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
5.
6. <!-- Spring的应用上下文 -->
7. <context-param>
8. <param-name>contextConfigLocation</param-name>
9. <param-value>classpath:/applicationContext*.xml</param-value>
10. </context-param>
11.
12. <!-- Struts2过滤器 -->
13. <filter>
14. <filter-name>struts2</filter-name>
15. <filter-class>
16. org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
17. </filter>
18. <filter-mapping>
19. <filter-name>struts2</filter-name>
20. <url-pattern>/*</url-pattern>
21. </filter-mapping>
22.
23. <!-- 字符编码过滤器 -->
24. <filter>
25. <filter-name>encodingFilter</filter-name>
26. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
27. <init-param>
28. <param-name>encoding</param-name>
29. <param-value>UTF-8</param-value>
30. </init-param>
31. <init-param>
32. <param-name>forceEncoding</param-name>
33. <param-value>true</param-value>
34. </init-param>
35. </filter>
36. <filter-mapping>
37. <filter-name>encodingFilter</filter-name>
38. <url-pattern>/*</url-pattern>
39. </filter-mapping>
40.
41. <!-- OpenSessionInView过滤器 -->
42. <filter>
43. <filter-name>openSessionInViewFilter</filter-name>
44. <filter-class>
45. org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
46. </filter-class>
47. </filter>
48. <filter-mapping>
49. <filter-name>openSessionInViewFilter</filter-name>
50. <url-pattern>/*</url-pattern>
51. </filter-mapping>
52.
53. <!--Spring的ApplicationContext 载入 -->
54. <listener>
55. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
56. </listener>
57.
58. <!-- Spring 刷新Introspector防止内存泄露 -->
59. <listener>
60. <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
61. </listener>
62.
63. <!-- session超时定义,单位为分钟 -->
64. <session-config>
65. <session-timeout>20</session-timeout>
66. </session-config>
67.
68. <!-- 欢迎文件列表 -->
69. <welcome-file-list>
70. <welcome-file>index.html</welcome-file>
71. </welcome-file-list>
72.
73. <!-- 出错页面定义 -->
74. <error-page>
75. <exception-type>java.lang.Throwable</exception-type>
76. <location>/common/500.jsp</location>
77. </error-page>
78. <error-page>
79. <error-code>500</error-code>
80. <location>/common/500.jsp</location>
81. </error-page>
82. <error-page>
83. <error-code>404</error-code>
84. <location>/common/404.jsp</location>
85. </error-page>
86. <error-page>
87. <error-code>403</error-code>
88. <location>/common/403.jsp</location>
89. </error-page>
90.</web-app>
2.<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
5.
6. <!-- Spring的应用上下文 -->
7. <context-param>
8. <param-name>contextConfigLocation</param-name>
9. <param-value>classpath:/applicationContext*.xml</param-value>
10. </context-param>
11.
12. <!-- Struts2过滤器 -->
13. <filter>
14. <filter-name>struts2</filter-name>
15. <filter-class>
16. org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
17. </filter>
18. <filter-mapping>
19. <filter-name>struts2</filter-name>
20. <url-pattern>/*</url-pattern>
21. </filter-mapping>
22.
23. <!-- 字符编码过滤器 -->
24. <filter>
25. <filter-name>encodingFilter</filter-name>
26. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
27. <init-param>
28. <param-name>encoding</param-name>
29. <param-value>UTF-8</param-value>
30. </init-param>
31. <init-param>
32. <param-name>forceEncoding</param-name>
33. <param-value>true</param-value>
34. </init-param>
35. </filter>
36. <filter-mapping>
37. <filter-name>encodingFilter</filter-name>
38. <url-pattern>/*</url-pattern>
39. </filter-mapping>
40.
41. <!-- OpenSessionInView过滤器 -->
42. <filter>
43. <filter-name>openSessionInViewFilter</filter-name>
44. <filter-class>
45. org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
46. </filter-class>
47. </filter>
48. <filter-mapping>
49. <filter-name>openSessionInViewFilter</filter-name>
50. <url-pattern>/*</url-pattern>
51. </filter-mapping>
52.
53. <!--Spring的ApplicationContext 载入 -->
54. <listener>
55. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
56. </listener>
57.
58. <!-- Spring 刷新Introspector防止内存泄露 -->
59. <listener>
60. <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
61. </listener>
62.
63. <!-- session超时定义,单位为分钟 -->
64. <session-config>
65. <session-timeout>20</session-timeout>
66. </session-config>
67.
68. <!-- 欢迎文件列表 -->
69. <welcome-file-list>
70. <welcome-file>index.html</welcome-file>
71. </welcome-file-list>
72.
73. <!-- 出错页面定义 -->
74. <error-page>
75. <exception-type>java.lang.Throwable</exception-type>
76. <location>/common/500.jsp</location>
77. </error-page>
78. <error-page>
79. <error-code>500</error-code>
80. <location>/common/500.jsp</location>
81. </error-page>
82. <error-page>
83. <error-code>404</error-code>
84. <location>/common/404.jsp</location>
85. </error-page>
86. <error-page>
87. <error-code>403</error-code>
88. <location>/common/403.jsp</location>
89. </error-page>
90.</web-app>