auth-url.jsp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <%@page contentType="text/html;charset=UTF-8"%>
  2. <%@page import="java.util.Collection"%>
  3. <%@page import="java.util.Map"%>
  4. <%@page import="org.springframework.context.ApplicationContext"%>
  5. <%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
  6. <%@page import="org.springframework.security.access.ConfigAttribute"%>
  7. <%@page import="org.springframework.security.web.access.intercept.FilterSecurityInterceptor"%>
  8. <%@page import="org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource"%>
  9. <%@page import="org.springframework.security.web.util.RequestMatcher"%>
  10. <%@page import="com.mossle.core.util.ReflectUtils"%>
  11. <%
  12. ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(application);
  13. FilterSecurityInterceptor filterSecurityInterceptor =
  14. (FilterSecurityInterceptor) ctx.getBean("org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0");
  15. FilterInvocationSecurityMetadataSource filterInvocationSecurityMetadataSource = filterSecurityInterceptor.getSecurityMetadataSource();
  16. Map<RequestMatcher, Collection<ConfigAttribute>> requestMap =
  17. (Map<RequestMatcher, Collection<ConfigAttribute>>)
  18. ReflectUtils.getFieldValue(filterInvocationSecurityMetadataSource, "requestMap");
  19. %>
  20. <html>
  21. <head>
  22. <meta charset="utf-8">
  23. <title>auth-url</title>
  24. <style>
  25. tbody tr:nth-child(odd) td,
  26. tbody tr:nth-child(odd) th {
  27. background-color: #f9f9f9;
  28. }
  29. </style>
  30. </head>
  31. <body>
  32. <table border="1" width="100%">
  33. <thead>
  34. <tr>
  35. <th>url</th>
  36. <th>perm</th>
  37. </tr>
  38. </thead>
  39. <tbody>
  40. <%
  41. for (Map.Entry<RequestMatcher, Collection<ConfigAttribute>> entry : requestMap.entrySet()) {
  42. pageContext.setAttribute("entry", entry);
  43. %>
  44. <tr>
  45. <td>${entry.key}</td>
  46. <td>${entry.value}</td>
  47. </tr>
  48. <%
  49. }
  50. %>
  51. </tbody>
  52. </table>
  53. </body>
  54. </html>