web.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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"
  4. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  5. version="2.5">
  6. <context-param>
  7. <param-name>contextConfigLocation</param-name>
  8. <param-value>
  9. classpath:spring/ApplicationContext-main.xml,
  10. classpath:spring/ApplicationContext-dataSource.xml,
  11. classpath:spring/ApplicationContext-shiro.xml,
  12. classpath:spring/ApplicationContext-redis.xml,
  13. classpath:spring/ApplicationContext-activiti.xml
  14. </param-value>
  15. </context-param>
  16. <filter>
  17. <filter-name>encodingFilter</filter-name>
  18. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  19. <init-param>
  20. <param-name>encoding</param-name>
  21. <param-value>utf-8</param-value>
  22. </init-param>
  23. </filter>
  24. <filter-mapping>
  25. <filter-name>encodingFilter</filter-name>
  26. <url-pattern>/*</url-pattern>
  27. </filter-mapping>
  28. <context-param>
  29. <param-name>webAppRootKey</param-name>
  30. <param-value>zhdt</param-value>
  31. </context-param>
  32. <!-- 连接池 启用Web监控统计功能 start-->
  33. <filter>
  34. <filter-name>DruidWebStatFilter</filter-name>
  35. <filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
  36. <init-param>
  37. <param-name>exclusions</param-name>
  38. <param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*</param-value>
  39. </init-param>
  40. </filter>
  41. <filter-mapping>
  42. <filter-name>DruidWebStatFilter</filter-name>
  43. <url-pattern>/*</url-pattern>
  44. </filter-mapping>
  45. <servlet>
  46. <servlet-name>DruidStatView</servlet-name>
  47. <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
  48. </servlet>
  49. <servlet-mapping>
  50. <servlet-name>DruidStatView</servlet-name>
  51. <url-pattern>/druid/*</url-pattern>
  52. </servlet-mapping>
  53. <!-- 连接池 启用Web监控统计功能 end-->
  54. <filter>
  55. <filter-name>loginFilter</filter-name>
  56. <filter-class>com.zhcs.dt.filter.LoginFilter</filter-class>
  57. </filter>
  58. <!-- log4j2-begin -->
  59. <listener>
  60. <listener-class>org.apache.logging.log4j.web.Log4jServletContextListener</listener-class>
  61. </listener>
  62. <filter>
  63. <filter-name>log4jServletFilter</filter-name>
  64. <filter-class>org.apache.logging.log4j.web.Log4jServletFilter</filter-class>
  65. </filter>
  66. <filter-mapping>
  67. <filter-name>log4jServletFilter</filter-name>
  68. <url-pattern>/*</url-pattern>
  69. <dispatcher>REQUEST</dispatcher>
  70. <dispatcher>FORWARD</dispatcher>
  71. <dispatcher>INCLUDE</dispatcher>
  72. <dispatcher>ERROR</dispatcher>
  73. </filter-mapping>
  74. <!-- log4j2-end -->
  75. <listener>
  76. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  77. </listener>
  78. <servlet>
  79. <servlet-name>springMvc</servlet-name>
  80. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  81. <init-param>
  82. <param-name>contextConfigLocation</param-name>
  83. <param-value>classpath:spring/ApplicationContext-mvc.xml</param-value>
  84. </init-param>
  85. <load-on-startup>1</load-on-startup>
  86. </servlet>
  87. <servlet-mapping>
  88. <servlet-name>springMvc</servlet-name>
  89. <url-pattern>/</url-pattern>
  90. </servlet-mapping>
  91. <!-- Shiro filter start -->
  92. <filter>
  93. <filter-name>shiroFilter</filter-name>
  94. <filter-class>
  95. org.springframework.web.filter.DelegatingFilterProxy
  96. </filter-class>
  97. <init-param>
  98. <param-name>targetFilterLifecycle</param-name>
  99. <param-value>true</param-value>
  100. </init-param>
  101. </filter>
  102. <filter-mapping>
  103. <filter-name>shiroFilter</filter-name>
  104. <url-pattern>/*</url-pattern>
  105. </filter-mapping>
  106. <!-- Shiro filter end -->
  107. <error-page>
  108. <error-code>404</error-code>
  109. <location>/404.jsp</location>
  110. </error-page>
  111. <!--
  112. <error-page>
  113. <error-code>405</error-code>
  114. <location>/WEB-INF/405.html</location>
  115. </error-page>
  116. <error-page>
  117. <error-code>404</error-code>
  118. <location>/WEB-INF/404.html</location>
  119. </error-page>
  120. <error-page>
  121. <error-code>500</error-code>
  122. <location>/WEB-INF/500.html</location>
  123. </error-page>
  124. <error-page>
  125. <error-code>javax.servle.ServletException</error-code>
  126. <location>/WEB-INF/error.html</location>
  127. </error-page>
  128. <error-page>
  129. <error-code>java.lang.NullPointerException</error-code>
  130. <location>/WEB-INF/error.html</location>
  131. </error-page>
  132. -->
  133. <session-config>
  134. <session-timeout>14400</session-timeout>
  135. </session-config>
  136. </web-app>