web-security-sso.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app version="2.5" 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_2_5.xsd">
  6. <!--
  7. <context-param> <param-name>contextConfigLocation</param-name>
  8. <param-value> classpath:/applicationContext.xml,
  9. classpath:/applicationContext-webservice.xml</param-value>
  10. </context-param>
  11. -->
  12. <!--
  13. 设置log4j存放Log文件位置(通过spring统一进行管理)-->
  14. <context-param>
  15. <param-name>webAppRootKey</param-name>
  16. <param-value>opal-isc.root</param-value>
  17. </context-param>
  18. <!--
  19. 加载log4j的配置文件-->
  20. <context-param>
  21. <param-name>log4jConfigLocation</param-name>
  22. <param-value>/WEB-INF/config/platform/log4j.properties</param-value>
  23. </context-param>
  24. <!--Spring默认刷新Log4j配置文件的间隔,单位为millisecond -->
  25. <context-param>
  26. <param-name>log4jRefreshInterval</param-name>
  27. <param-value>60000</param-value>
  28. </context-param>
  29. <!--Spring用于log4j初始化的监听器 -->
  30. <listener>
  31. <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  32. </listener>
  33. <!-- CAS注销生效监听 -->
  34. <listener>
  35. <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
  36. </listener>
  37. <!--
  38. 此监听器会在session创建和销毁的时候通知Spring Security 如果要限制用户登录个数,这里就要配置.
  39. -->
  40. <listener>
  41. <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
  42. </listener>
  43. <!--
  44. 加载Spring XML配置文件,Spring安全配置及各类资源文件
  45. -->
  46. <context-param>
  47. <param-name>contextConfigLocation</param-name>
  48. <param-value>
  49. /WEB-INF/config/platform/applicationContext.xml,
  50. /WEB-INF/config/platform/applicationContext-security-sso.xml
  51. </param-value>
  52. </context-param>
  53. <!--spring监听器的配置,用于在启动Web容器时,自动装配ApplicationContext的配置信息-->
  54. <listener>
  55. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  56. </listener>
  57. <listener>
  58. <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
  59. </listener>
  60. <!-- 使用Spring中的过滤器解决在请求和应答中的中文乱码问题 -->
  61. <filter>
  62. <filter-name>encodingFilter</filter-name>
  63. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  64. <init-param>
  65. <param-name>encoding</param-name>
  66. <param-value>UTF-8</param-value>
  67. </init-param>
  68. <init-param>
  69. <param-name>forceEncoding</param-name>
  70. <param-value>true</param-value>
  71. </init-param>
  72. </filter>
  73. <!--Spring Secutiry的过滤器链配置-->
  74. <filter>
  75. <filter-name>springSecurityFilterChain</filter-name>
  76. <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
  77. </filter>
  78. <filter>
  79. <filter-name>baseWebContextFilter</filter-name>
  80. <filter-class>com.xc.opal.base.web.filter.BaseWebContextFilter</filter-class>
  81. <init-param>
  82. <param-name>excludeUrl</param-name>
  83. <param-value>/resources/,/login,/login/authentication,/logout,/forbidden.html,/services/</param-value>
  84. </init-param>
  85. </filter>
  86. <filter-mapping>
  87. <filter-name>encodingFilter</filter-name>
  88. <url-pattern>/*</url-pattern>
  89. </filter-mapping>
  90. <!---->
  91. <filter-mapping>
  92. <filter-name>springSecurityFilterChain</filter-name>
  93. <url-pattern>/*</url-pattern>
  94. </filter-mapping>
  95. <filter-mapping>
  96. <filter-name>baseWebContextFilter</filter-name>
  97. <url-pattern>/*</url-pattern>
  98. </filter-mapping>
  99. <servlet>
  100. <servlet-name>SpringDispatcherServlet</servlet-name>
  101. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  102. <init-param>
  103. <param-name>contextConfigLocation</param-name>
  104. <param-value>/WEB-INF/config/platform/applicationContext-servlet.xml</param-value>
  105. </init-param>
  106. <load-on-startup>1</load-on-startup>
  107. </servlet>
  108. <!--
  109. <servlet> <servlet-name>cxf</servlet-name>
  110. <display-name>cxf</display-name> <description>ApacheCXF</description>
  111. <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
  112. <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping>
  113. <servlet-name>cxf</servlet-name>
  114. <url-pattern>/services/*</url-pattern> </servlet-mapping>
  115. -->
  116. <servlet-mapping>
  117. <servlet-name>SpringDispatcherServlet</servlet-name>
  118. <url-pattern>/</url-pattern>
  119. </servlet-mapping>
  120. <!-- *********************报表工具*******************************-->
  121. <servlet>
  122. <servlet-name>ReportServer</servlet-name>
  123. <servlet-class>com.fr.web.ReportServlet</servlet-class>
  124. <load-on-startup>0</load-on-startup>
  125. </servlet>
  126. <servlet-mapping>
  127. <servlet-name>ReportServer</servlet-name>
  128. <url-pattern>/ReportServer</url-pattern>
  129. </servlet-mapping>
  130. <!-- *************************报表结束********************************
  131. <welcome-file-list>
  132. <welcome-file>/login1.jsp</welcome-file>
  133. </welcome-file-list>-->
  134. <!-- 异常处理 -->
  135. <error-page>
  136. <error-code>403</error-code>
  137. <location>/403.jsp</location>
  138. </error-page>
  139. <error-page>
  140. <error-code>404</error-code>
  141. <location>/404.jsp</location>
  142. </error-page>
  143. <error-page>
  144. <error-code>505</error-code>
  145. <location>/505.jsp</location>
  146. </error-page>
  147. </web-app>