web.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_3_0.xsd"
  5. version="3.0">
  6. <context-param>
  7. <param-name>contextConfigLocation</param-name>
  8. <param-value>
  9. classpath*:/spring/spring*.xml
  10. </param-value>
  11. </context-param>
  12. <context-param>
  13. <param-name>log4jConfigLocation</param-name>
  14. <param-value>classpath:/log/log4j.xml</param-value>
  15. </context-param>
  16. <context-param>
  17. <param-name>webAppRootKey</param-name>
  18. <param-value>app.root</param-value>
  19. </context-param>
  20. <context-param>
  21. <param-name>log4jRefreshInterval</param-name>
  22. <param-value>3000</param-value>
  23. </context-param>
  24. <listener>
  25. <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  26. </listener>
  27. <!--Spring的ApplicationContext 载入 -->
  28. <listener>
  29. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  30. </listener>
  31. <!-- To allow session-scoped beans in Spring 【SystemAuthenticationListener】 -->
  32. <listener>
  33. <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
  34. </listener>
  35. <!-- Character Encoding filter -->
  36. <filter>
  37. <filter-name>encodingFilter</filter-name>
  38. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  39. <init-param>
  40. <param-name>encoding</param-name>
  41. <param-value>UTF-8</param-value>
  42. </init-param>
  43. <init-param>
  44. <param-name>forceEncoding</param-name>
  45. <param-value>true</param-value>
  46. </init-param>
  47. </filter>
  48. <filter-mapping>
  49. <filter-name>encodingFilter</filter-name>
  50. <url-pattern>/*</url-pattern>
  51. </filter-mapping>
  52. <!-- Spring MVC Servlet -->
  53. <servlet>
  54. <servlet-name>springServlet</servlet-name>
  55. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  56. <init-param>
  57. <param-name>contextConfigLocation</param-name>
  58. <param-value>classpath*:/spring/mvc.xml</param-value>
  59. </init-param>
  60. <load-on-startup>2</load-on-startup>
  61. </servlet>
  62. <servlet-mapping>
  63. <servlet-name>springServlet</servlet-name>
  64. <url-pattern>/</url-pattern>
  65. </servlet-mapping>
  66. <servlet>
  67. <servlet-name>InitServlet</servlet-name>
  68. <servlet-class>com.xt.hb.data.core.InitServlet</servlet-class>
  69. <load-on-startup>3</load-on-startup>
  70. </servlet>
  71. </web-app>