web.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  4. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  5. id="WebApp_ID" version="2.5">
  6. <display-name>mes</display-name>
  7. <distributable />
  8. <filter>
  9. <filter-name>encodingFilter</filter-name>
  10. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  11. <init-param>
  12. <param-name>encoding</param-name>
  13. <param-value>UTF-8</param-value>
  14. </init-param>
  15. <init-param>
  16. <param-name>forceEncoding</param-name>
  17. <param-value>true</param-value>
  18. </init-param>
  19. </filter>
  20. <filter-mapping>
  21. <filter-name>encodingFilter</filter-name>
  22. <url-pattern>*.action</url-pattern>
  23. </filter-mapping>
  24. <servlet>
  25. <servlet-name>mes-servlet</servlet-name>
  26. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  27. <init-param>
  28. <param-name>contextConfigLocation</param-name>
  29. <param-value>
  30. /WEB-INF/spring/config.xml
  31. </param-value>
  32. </init-param>
  33. <load-on-startup>1</load-on-startup>
  34. </servlet>
  35. <servlet-mapping>
  36. <servlet-name>mes-servlet</servlet-name>
  37. <url-pattern>/</url-pattern>
  38. </servlet-mapping>
  39. <error-page>
  40. <error-code>404</error-code>
  41. <location>/jsps/error/e-404.jsp</location>
  42. </error-page>
  43. <error-page>
  44. <error-code>500</error-code>
  45. <location>/jsps/error/e-500.jsp</location>
  46. </error-page>
  47. <session-config>
  48. <session-timeout>600</session-timeout>
  49. </session-config>
  50. <!-- 服务器主动缓存 -->
  51. <filter>
  52. <filter-name>NoCache</filter-name>
  53. <filter-class>com.uas.mes.core.listener.ResponseHeaderFilter</filter-class>
  54. <init-param>
  55. <param-name>Cache-Control</param-name>
  56. <param-value>no-cache, must-revalidate</param-value>
  57. </init-param>
  58. </filter>
  59. <filter>
  60. <filter-name>CacheForWeek</filter-name>
  61. <filter-class>com.uas.mes.core.listener.ResponseHeaderFilter</filter-class>
  62. <init-param>
  63. <param-name>Cache-Control</param-name>
  64. <param-value>max-age=604800, public</param-value>
  65. </init-param>
  66. </filter>
  67. <filter-mapping>
  68. <filter-name>NoCache</filter-name>
  69. <url-pattern>*.action</url-pattern>
  70. </filter-mapping>
  71. <filter-mapping>
  72. <filter-name>NoCache</filter-name>
  73. <url-pattern>*.xls</url-pattern>
  74. </filter-mapping>
  75. <filter-mapping>
  76. <filter-name>NoCache</filter-name>
  77. <url-pattern>*.pdf</url-pattern>
  78. </filter-mapping>
  79. <filter-mapping>
  80. <filter-name>CacheForWeek</filter-name>
  81. <url-pattern>*.js</url-pattern>
  82. </filter-mapping>
  83. <filter-mapping>
  84. <filter-name>CacheForWeek</filter-name>
  85. <url-pattern>*.css</url-pattern>
  86. </filter-mapping>
  87. <filter-mapping>
  88. <filter-name>CacheForWeek</filter-name>
  89. <url-pattern>*.scss</url-pattern>
  90. </filter-mapping>
  91. <filter-mapping>
  92. <filter-name>CacheForWeek</filter-name>
  93. <url-pattern>*.html</url-pattern>
  94. </filter-mapping>
  95. <filter-mapping>
  96. <filter-name>CacheForWeek</filter-name>
  97. <url-pattern>*.jsp</url-pattern>
  98. </filter-mapping>
  99. <filter-mapping>
  100. <filter-name>CacheForWeek</filter-name>
  101. <url-pattern>/app/*</url-pattern>
  102. </filter-mapping>
  103. <filter-mapping>
  104. <filter-name>CacheForWeek</filter-name>
  105. <url-pattern>/view/*</url-pattern>
  106. </filter-mapping>
  107. <filter-mapping>
  108. <filter-name>CacheForWeek</filter-name>
  109. <url-pattern>/lib/*</url-pattern>
  110. </filter-mapping>
  111. <filter-mapping>
  112. <filter-name>CacheForWeek</filter-name>
  113. <url-pattern>/style/*</url-pattern>
  114. </filter-mapping>
  115. </web-app>