web.xml 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns="http://java.sun.com/xml/ns/javaee"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
  5. http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
  6. version="3.0">
  7. <listener>
  8. <listener-class>com.yihu.ehr.common.ApplicationStart</listener-class>
  9. </listener>
  10. <!--servlet设-->
  11. <servlet>
  12. <servlet-name>dispatcher</servlet-name>
  13. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  14. <load-on-startup>1</load-on-startup>
  15. </servlet>
  16. <servlet-mapping>
  17. <servlet-name>dispatcher</servlet-name>
  18. <url-pattern>/</url-pattern>
  19. </servlet-mapping>
  20. <!--过滤器-->
  21. <filter>
  22. <filter-name>characterEncodingFilter</filter-name>
  23. <filter-class>
  24. org.springframework.web.filter.CharacterEncodingFilter
  25. </filter-class>
  26. <init-param>
  27. <param-name>encoding</param-name>
  28. <param-value>UTF-8</param-value>
  29. </init-param>
  30. <init-param>
  31. <param-name>forceEncoding</param-name>
  32. <param-value>true</param-value>
  33. </init-param>
  34. </filter>
  35. <filter-mapping>
  36. <filter-name>characterEncodingFilter</filter-name>
  37. <url-pattern>/*</url-pattern>
  38. </filter-mapping>
  39. <!--采用默认过滤器-->
  40. <filter>
  41. <filter-name>SpringOpenSessionInViewFilter</filter-name>
  42. <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
  43. </filter>
  44. <filter-mapping>
  45. <filter-name>SpringOpenSessionInViewFilter</filter-name>
  46. <url-pattern>/*</url-pattern>
  47. </filter-mapping>
  48. <filter>
  49. <filter-name>CheckLoginFilter</filter-name>
  50. <filter-class>com.yihu.ehr.common.CheckLoginFilter</filter-class>
  51. <init-param>
  52. <param-name>redirectURL</param-name>
  53. <param-value>/loginPage</param-value>
  54. </init-param>
  55. <init-param>
  56. <param-name>notCheckURLList</param-name>
  57. <param-value>/loginPage;/system/loginAction;/error;/datapush/datapush</param-value>
  58. </init-param>
  59. </filter>
  60. <filter-mapping>
  61. <filter-name>CheckLoginFilter</filter-name>
  62. <url-pattern>/*</url-pattern>
  63. </filter-mapping>
  64. <!--Spring-->
  65. <listener>
  66. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  67. </listener>
  68. <context-param>
  69. <param-name>contextConfigLocation</param-name>
  70. <param-value>classpath:spring/applicationContext.xml</param-value>
  71. </context-param>
  72. <!--log4j2-->
  73. <listener>
  74. <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  75. </listener>
  76. <context-param>
  77. <param-name>log4jConfigLocation</param-name>
  78. <param-value>classpath:log4j/log4j2.xml</param-value>
  79. </context-param>
  80. <context-param>
  81. <param-name>log4jRefreshInterval</param-name>
  82. <param-value>60000</param-value>
  83. </context-param>
  84. <!-- 默认页面 -->
  85. <welcome-file-list>
  86. <welcome-file>/indexPage</welcome-file>
  87. </welcome-file-list>
  88. </web-app>