filterChain.jsp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <%@page contentType="text/html;charset=UTF-8"%>
  2. <%@page import="org.springframework.context.ApplicationContext"%>
  3. <%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
  4. <%@page import="org.springframework.security.web.FilterChainProxy"%>
  5. <%@page import="org.springframework.security.web.SecurityFilterChain"%>
  6. <%@page import="javax.servlet.Filter"%>
  7. <%
  8. ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(application);
  9. FilterChainProxy filterChainProxy = (FilterChainProxy) ctx.getBean("org.springframework.security.filterChainProxy");
  10. %>
  11. <html>
  12. <head>
  13. <meta charset="utf-8">
  14. <title>filterChain</title>
  15. <style>
  16. tbody tr:nth-child(odd) td,
  17. tbody tr:nth-child(odd) th {
  18. background-color: #f9f9f9;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <table border="1">
  24. <thead>
  25. <tr>
  26. <th>requestMatcher</th>
  27. <th>filters</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. <%
  32. for (SecurityFilterChain securityFilterChain : filterChainProxy.getFilterChains()) {
  33. pageContext.setAttribute("securityFilterChain", securityFilterChain);
  34. %>
  35. <tr>
  36. <td>${securityFilterChain.requestMatcher}</td>
  37. <td>
  38. <%
  39. for (Filter filter : securityFilterChain.getFilters()) {
  40. pageContext.setAttribute("filter", filter);
  41. %>
  42. ${filter}<br>
  43. <%
  44. }
  45. %>
  46. &nbsp;
  47. </td>
  48. </tr>
  49. <%
  50. }
  51. %>
  52. </tbody>
  53. </table>
  54. </body>
  55. </html>