web.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to Jasig under one or more contributor license
  4. agreements. See the NOTICE file distributed with this work
  5. for additional information regarding copyright ownership.
  6. Jasig licenses this file to you under the Apache License,
  7. Version 2.0 (the "License"); you may not use this file
  8. except in compliance with the License. You may obtain a
  9. copy of the License at the following location:
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing,
  12. software distributed under the License is distributed on an
  13. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. KIND, either express or implied. See the License for the
  15. specific language governing permissions and limitations
  16. under the License.
  17. -->
  18. <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
  19. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  20. xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
  21. version="2.4">
  22. <display-name>Central Authentication System (CAS) ${project.version}</display-name>
  23. <context-param>
  24. <param-name>contextConfigLocation</param-name>
  25. <param-value>
  26. /WEB-INF/spring-configuration/*.xml
  27. /WEB-INF/deployerConfigContext.xml
  28. </param-value>
  29. </context-param>
  30. <filter>
  31. <filter-name>CAS Client Info Logging Filter</filter-name>
  32. <filter-class>com.github.inspektr.common.web.ClientInfoThreadLocalFilter</filter-class>
  33. </filter>
  34. <filter>
  35. <filter-name>loginfilter</filter-name>
  36. <filter-class>com.jsjty.sso.common.ManagerLoginFilter</filter-class>
  37. <init-param>
  38. <param-name>redirectURL</param-name>
  39. <param-value>/login.html,/user/virtualDrive.html</param-value>
  40. </init-param>
  41. <init-param>
  42. <param-name>patternURL</param-name>
  43. <param-value></param-value>
  44. </init-param>
  45. </filter>
  46. <filter-mapping>
  47. <filter-name>CAS Client Info Logging Filter</filter-name>
  48. <url-pattern>/*</url-pattern>
  49. </filter-mapping>
  50. <filter>
  51. <filter-name>springSecurityFilterChain</filter-name>
  52. <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
  53. </filter>
  54. <filter-mapping>
  55. <filter-name>springSecurityFilterChain</filter-name>
  56. <url-pattern>/status</url-pattern>
  57. </filter-mapping>
  58. <filter-mapping>
  59. <filter-name>springSecurityFilterChain</filter-name>
  60. <url-pattern>/services/*</url-pattern>
  61. </filter-mapping>
  62. <filter>
  63. <filter-name>characterEncodingFilter</filter-name>
  64. <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
  65. </filter>
  66. <filter-mapping>
  67. <filter-name>characterEncodingFilter</filter-name>
  68. <url-pattern>/*</url-pattern>
  69. </filter-mapping>
  70. <filter-mapping>
  71. <filter-name>loginfilter</filter-name>
  72. <url-pattern>*.html</url-pattern>
  73. </filter-mapping>
  74. <!--
  75. - Loads the CAS ApplicationContext.
  76. - The deployer choice here is how to handle Throwables thrown by Spring's
  77. - ContextLoaderListener. The Spring ContextLoaderListener will throw an exception when the
  78. - application context cannot be loaded, say because the bean XML files are not valid XML or do not
  79. - refer to real classes and properties or because a bean configured via Spring throws an exception
  80. - at construction, property setting, or on an afterPropertiesSet() lifecycle method.
  81. -
  82. - If you'd like these errors to be fatal and prevent the CAS servlet context from loading at all,
  83. - use org.springframework.web.context.ContextLoaderListener.
  84. -
  85. - If you'd like these errors to result in all requests for CAS getting a "CAS is Unavailable" response,
  86. - use org.jasig.cas.web.init.SafeContextLoaderListener
  87. -->
  88. <listener>
  89. <listener-class>
  90. org.jasig.cas.web.init.SafeContextLoaderListener
  91. </listener-class>
  92. </listener>
  93. <servlet>
  94. <servlet-name>CXFService</servlet-name>
  95. <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
  96. <load-on-startup>1</load-on-startup>
  97. </servlet>
  98. <servlet-mapping>
  99. <servlet-name>CXFService</servlet-name>
  100. <url-pattern>/service/*</url-pattern>
  101. </servlet-mapping>
  102. <!--
  103. - This is the Spring dispatcher servlet which delegates all requests to the
  104. - Spring WebMVC controllers as configured in cas-servlet.xml.
  105. -
  106. - The choice made above about how to handle a broken ApplicationContext at
  107. - context initialization applies here as well, since this servlet is load-on-startup.
  108. -
  109. - If you'd like these errors to be fatal and prevent the CAS servlet from loading at all,
  110. - use org.springframework.web.servlet.DispatcherServlet.
  111. -
  112. - If you'd like these errors to result in all requests for CAS getting a "CAS is Unavailable" response,
  113. - use org.jasig.cas.web.init.SafeDispatcherServlet
  114. -->
  115. <servlet>
  116. <servlet-name>cas</servlet-name>
  117. <servlet-class>
  118. org.jasig.cas.web.init.SafeDispatcherServlet
  119. </servlet-class>
  120. <init-param>
  121. <param-name>publishContext</param-name>
  122. <param-value>false</param-value>
  123. </init-param>
  124. <init-param>
  125. <param-name>encoding</param-name>
  126. <param-value>UTF-8</param-value>
  127. </init-param>
  128. <load-on-startup>1</load-on-startup>
  129. </servlet>
  130. <servlet>
  131. <servlet-name>spring</servlet-name>
  132. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  133. <init-param>
  134. <param-name>contextConfigLocation</param-name>
  135. <param-value>/WEB-INF/spring-servlet.xml</param-value>
  136. </init-param>
  137. <load-on-startup>1</load-on-startup>
  138. </servlet>
  139. <servlet-mapping>
  140. <servlet-name>cas</servlet-name>
  141. <url-pattern>/login</url-pattern>
  142. </servlet-mapping>
  143. <servlet-mapping>
  144. <servlet-name>cas</servlet-name>
  145. <url-pattern>/logout</url-pattern>
  146. </servlet-mapping>
  147. <servlet-mapping>
  148. <servlet-name>cas</servlet-name>
  149. <url-pattern>/validate</url-pattern>
  150. </servlet-mapping>
  151. <servlet-mapping>
  152. <servlet-name>cas</servlet-name>
  153. <url-pattern>/serviceValidate</url-pattern>
  154. </servlet-mapping>
  155. <servlet-mapping>
  156. <servlet-name>cas</servlet-name>
  157. <url-pattern>/samlValidate</url-pattern>
  158. </servlet-mapping>
  159. <servlet-mapping>
  160. <servlet-name>cas</servlet-name>
  161. <url-pattern>/proxy</url-pattern>
  162. </servlet-mapping>
  163. <servlet-mapping>
  164. <servlet-name>cas</servlet-name>
  165. <url-pattern>/proxyValidate</url-pattern>
  166. </servlet-mapping>
  167. <servlet-mapping>
  168. <servlet-name>cas</servlet-name>
  169. <url-pattern>/CentralAuthenticationService</url-pattern>
  170. </servlet-mapping>
  171. <servlet-mapping>
  172. <servlet-name>cas</servlet-name>
  173. <url-pattern>/services/add.html</url-pattern>
  174. </servlet-mapping>
  175. <servlet-mapping>
  176. <servlet-name>cas</servlet-name>
  177. <url-pattern>/services/viewStatistics.html</url-pattern>
  178. </servlet-mapping>
  179. <servlet-mapping>
  180. <servlet-name>cas</servlet-name>
  181. <url-pattern>/services/logout.html</url-pattern>
  182. </servlet-mapping>
  183. <servlet-mapping>
  184. <servlet-name>cas</servlet-name>
  185. <url-pattern>/services/loggedOut.html</url-pattern>
  186. </servlet-mapping>
  187. <servlet-mapping>
  188. <servlet-name>cas</servlet-name>
  189. <url-pattern>/services/manage.html</url-pattern>
  190. </servlet-mapping>
  191. <servlet-mapping>
  192. <servlet-name>cas</servlet-name>
  193. <url-pattern>/services/edit.html</url-pattern>
  194. </servlet-mapping>
  195. <servlet-mapping>
  196. <servlet-name>cas</servlet-name>
  197. <url-pattern>/openid/*</url-pattern>
  198. </servlet-mapping>
  199. <servlet-mapping>
  200. <servlet-name>cas</servlet-name>
  201. <url-pattern>/services/deleteRegisteredService.html</url-pattern>
  202. </servlet-mapping>
  203. <servlet-mapping>
  204. <servlet-name>cas</servlet-name>
  205. <url-pattern>/services/updateRegisteredServiceEvaluationOrder.html</url-pattern>
  206. </servlet-mapping>
  207. <servlet-mapping>
  208. <servlet-name>cas</servlet-name>
  209. <url-pattern>/status</url-pattern>
  210. </servlet-mapping>
  211. <servlet-mapping>
  212. <servlet-name>cas</servlet-name>
  213. <url-pattern>/authorizationFailure.html</url-pattern>
  214. </servlet-mapping>
  215. <servlet-mapping>
  216. <servlet-name>cas</servlet-name>
  217. <url-pattern>/403.html</url-pattern>
  218. </servlet-mapping>
  219. <servlet-mapping>
  220. <servlet-name>spring</servlet-name>
  221. <url-pattern>*.html</url-pattern>
  222. </servlet-mapping>
  223. <servlet-mapping>
  224. <servlet-name>spring</servlet-name>
  225. <url-pattern>*.do</url-pattern>
  226. </servlet-mapping>
  227. <!--
  228. <servlet>
  229. <servlet-name>restlet</servlet-name>
  230. <servlet-class>com.noelios.restlet.ext.spring.RestletFrameworkServlet</servlet-class>
  231. <load-on-startup>1</load-on-startup>
  232. </servlet>
  233. <servlet-mapping>
  234. <servlet-name>restlet</servlet-name>
  235. <url-pattern>/v1/*</url-pattern>
  236. </servlet-mapping>
  237. -->
  238. <session-config>
  239. <!-- Default to 5 minute session timeouts 一天-->
  240. <session-timeout>3600</session-timeout>
  241. </session-config>
  242. <error-page>
  243. <exception-type>org.springframework.context.ApplicationContextException</exception-type>
  244. <location>/WEB-INF/view/jsp/brokenContext.jsp</location>
  245. </error-page>
  246. <error-page>
  247. <error-code>500</error-code>
  248. <location>/WEB-INF/view/jsp/errors.jsp</location>
  249. </error-page>
  250. <error-page>
  251. <error-code>404</error-code>
  252. <location>/</location>
  253. </error-page>
  254. <error-page>
  255. <error-code>403</error-code>
  256. <location>/403.html</location>
  257. </error-page>
  258. <welcome-file-list>
  259. <welcome-file>index.jsp</welcome-file>
  260. </welcome-file-list>
  261. </web-app>