Java代码 web.xml _D web.xml _D_02

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <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/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  3. <display-name>web-site</display-name>
  4.  
  5. <context-param>
  6. <param-name>contextConfigLocation</param-name>
  7. <param-value>/config/applicationContext-base.xml</param-value>
  8. </context-param>
  9.  
  10. <listener>
  11. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  12. </listener>
  13.  
  14. <filter>
  15. <filter-name>sitemesh</filter-name>
  16. <filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
  17. <init-param>
  18. <param-name>configFile</param-name>
  19. <param-value>/config/sitemesh.xml</param-value>
  20. </init-param>
  21. </filter>
  22.  
  23. <filter-mapping>
  24. <filter-name>sitemesh</filter-name>
  25. <url-pattern>/*</url-pattern>
  26. </filter-mapping>
  27.  
  28. <!--
  29. <filter>
  30. <filter-name>struts-prepare</filter-name>
  31. <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
  32. </filter>
  33. -->
  34.  
  35. <filter>
  36. <filter-name>struts2</filter-name>
  37. <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
  38. <!--
  39. <init-param>
  40. <param-name>config</param-name>
  41. <param-value>
  42. struts-default.xml,struts-plugin.xml,struts.xml,conf/my.struts.xml
  43. </param-value>
  44. </init-param>
  45. -->
  46.  
  47. </filter>
  48.  
  49. <!--
  50. <filter-mapping>
  51. <filter-name>struts-prepare</filter-name>
  52. <url-pattern>/*</url-pattern>
  53. </filter-mapping>
  54. -->
  55.  
  56. <filter-mapping>
  57. <filter-name>struts2</filter-name>
  58. <url-pattern>/*</url-pattern>
  59. </filter-mapping>
  60.  
  61. <filter>
  62. <filter-name>encodingFilter</filter-name>
  63. <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
  64. <init-param>
  65. <param-name>targetFilterLifecycle</param-name>
  66. <param-value>true</param-value>
  67. </init-param>
  68. </filter>
  69.  
  70. <filter-mapping>
  71. <filter-name>encodingFilter</filter-name>
  72. <url-pattern>/*</url-pattern>
  73. </filter-mapping>
  74.  
  75. <servlet>
  76. <servlet-name>JspSupportServlet</servlet-name>
  77. <servlet-class>org.apache.struts2.views.JspSupportServlet</servlet-class>
  78. <load-on-startup>1</load-on-startup>
  79. </servlet>
  80.  
  81. <servlet>
  82. <servlet-name>dwr</servlet-name>
  83. <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
  84. <init-param>
  85. <param-name>config</param-name>
  86. <param-value>config/dwr.xml</param-value>
  87. </init-param>
  88. <init-param>
  89. <param-name>debug</param-name>
  90. <param-value>true</param-value>
  91. </init-param>
  92. </servlet>
  93.  
  94. <servlet-mapping>
  95. <servlet-name>dwr</servlet-name>
  96. <url-pattern>/dwr/*</url-pattern>
  97. </servlet-mapping>
  98.  
  99. <servlet>
  100. <servlet-name>sitemesh-freemarker</servlet-name>
  101. <servlet-class>org.apache.struts2.sitemesh.FreemarkerDecoratorServlet</servlet-class>
  102. <!--
  103. <init-param>
  104. <param-name>TemplatePath</param-name>
  105. <param-value>/page/decorator/</param-value>
  106. </init-param>
  107. -->
  108. <init-param>
  109. <param-name>default_encoding</param-name>
  110. <param-value>UTF-8</param-value>
  111. </init-param>
  112. <load-on-startup>1</load-on-startup>
  113. </servlet>
  114.  
  115. <servlet-mapping>
  116. <servlet-name>sitemesh-freemarker</servlet-name>
  117. <url-pattern>*.ftl</url-pattern>
  118. </servlet-mapping>
  119.  
  120. <listener>
  121. <listener-class>org.apache.struts2.dispatcher.ng.listener.StrutsListener</listener-class>
  122. </listener>
  123.  
  124. <jsp-config>
  125. <taglib>
  126. <taglib-uri>sitemesh-decorator</taglib-uri>
  127. <taglib-location>/tld/sitemesh-decorator.tld</taglib-location>
  128. </taglib>
  129.  
  130. <taglib>
  131. <taglib-uri>sitemesh-page</taglib-uri>
  132. <taglib-location>/tld/sitemesh-page.tld</taglib-location>
  133. </taglib>
  134. </jsp-config>
  135.  
  136.  
  137. <error-page>
  138. <error-code>400</error-code>
  139. <location>/page/error/error.jsp</location>
  140. </error-page>
  141. <error-page>
  142. <error-code>401</error-code>
  143. <location>/page/error/error.jsp</location>
  144. </error-page>
  145. <error-page>
  146. <error-code>402</error-code>
  147. <location>/page/error/error.jsp</location>
  148. </error-page>
  149. <error-page>
  150. <error-code>403</error-code>
  151. <location>/page/error/error.jsp</location>
  152. </error-page>
  153. <error-page>
  154. <error-code>404</error-code>
  155. <location>/page/error/error.jsp</location>
  156. </error-page>
  157. <error-page>
  158. <error-code>405</error-code>
  159. <location>/page/error/error.jsp</location>
  160. </error-page>
  161. <error-page>
  162. <error-code>406</error-code>
  163. <location>/page/error/error.jsp</location>
  164. </error-page>
  165. <error-page>
  166. <error-code>407</error-code>
  167. <location>/page/error/error.jsp</location>
  168. </error-page>
  169. <error-page>
  170. <error-code>413</error-code>
  171. <location>/page/error/error.jsp</location>
  172. </error-page>
  173. <error-page>
  174. <error-code>414</error-code>
  175. <location>/page/error/error.jsp</location>
  176. </error-page>
  177. <error-page>
  178. <error-code>500</error-code>
  179. <location>/page/error/error.jsp</location>
  180. </error-page>
  181.  
  182. <error-page>
  183. <exception-type>java.lang.Exception</exception-type>
  184. <location>/page/error/errorException.jsp</location>
  185. </error-page>
  186.  
  187. <welcome-file-list>
  188. <welcome-file></welcome-file>
  189. </welcome-file-list>
  190. </web-app>