web.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
  5. version="4.0">
  6. <display-name>PMS</display-name>
  7. <welcome-file-list>
  8. <welcome-file>/js/index.jsp</welcome-file>
  9. </welcome-file-list>
  10. <resource-ref>
  11. <res-ref-name>jdbc/dc</res-ref-name>
  12. <res-type>javax.sql.DataSource</res-type>
  13. <res-auth>Container</res-auth>
  14. </resource-ref>
  15. <resource-ref>
  16. <res-ref-name>jdbc/face_collect</res-ref-name>
  17. <res-type>javax.sql.DataSource</res-type>
  18. <res-auth>Container</res-auth>
  19. </resource-ref>
  20. <!--
  21. 性能优化:HTML 和业务响应保持不缓存;版本化较弱的静态资源使用短期缓存,
  22. 并依靠 ETag/Last-Modified 在到期后校验。避免 JSP 和服务接口被浏览器长期缓存。
  23. -->
  24. <filter>
  25. <filter-name>ExpiresFilter</filter-name>
  26. <filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
  27. <init-param>
  28. <param-name>ExpiresDefault</param-name>
  29. <param-value>access plus 0 seconds</param-value>
  30. </init-param>
  31. <init-param>
  32. <param-name>ExpiresByType text/html</param-name>
  33. <param-value>access plus 0 seconds</param-value>
  34. </init-param>
  35. <init-param>
  36. <param-name>ExpiresByType application/json</param-name>
  37. <param-value>access plus 0 seconds</param-value>
  38. </init-param>
  39. <init-param>
  40. <param-name>ExpiresByType text/css</param-name>
  41. <param-value>access plus 1 hour</param-value>
  42. </init-param>
  43. <init-param>
  44. <param-name>ExpiresByType text/javascript</param-name>
  45. <param-value>access plus 1 hour</param-value>
  46. </init-param>
  47. <init-param>
  48. <param-name>ExpiresByType application/javascript</param-name>
  49. <param-value>access plus 1 hour</param-value>
  50. </init-param>
  51. <init-param>
  52. <param-name>ExpiresByType image/png</param-name>
  53. <param-value>access plus 1 day</param-value>
  54. </init-param>
  55. <init-param>
  56. <param-name>ExpiresByType image/jpeg</param-name>
  57. <param-value>access plus 1 day</param-value>
  58. </init-param>
  59. <init-param>
  60. <param-name>ExpiresByType image/gif</param-name>
  61. <param-value>access plus 1 day</param-value>
  62. </init-param>
  63. <init-param>
  64. <param-name>ExpiresByType image/svg+xml</param-name>
  65. <param-value>access plus 1 day</param-value>
  66. </init-param>
  67. <init-param>
  68. <param-name>ExpiresByType font/woff2</param-name>
  69. <param-value>access plus 30 days</param-value>
  70. </init-param>
  71. </filter>
  72. <filter-mapping>
  73. <filter-name>ExpiresFilter</filter-name>
  74. <url-pattern>/*</url-pattern>
  75. <dispatcher>REQUEST</dispatcher>
  76. <dispatcher>FORWARD</dispatcher>
  77. <dispatcher>INCLUDE</dispatcher>
  78. </filter-mapping>
  79. <filter-mapping>
  80. <filter-name>UrlFilter</filter-name>
  81. <url-pattern>/*</url-pattern>
  82. </filter-mapping>
  83. <filter-mapping>
  84. <filter-name>TokenFilter</filter-name>
  85. <url-pattern>/*</url-pattern>
  86. </filter-mapping>
  87. </web-app>