2
0

debug.jsp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <%@ page import="net.sf.acegisecurity.context.Context" %>
  2. <%@ page import="net.sf.acegisecurity.context.ContextHolder" %>
  3. <%@ page import="net.sf.acegisecurity.context.SecureContext" %>
  4. <%@ page import="net.sf.acegisecurity.Authentication" %>
  5. <%@ page import="net.sf.acegisecurity.GrantedAuthority" %>
  6. <%@ page import="net.sf.acegisecurity.adapters.AuthByAdapter" %>
  7. <% Context context = ContextHolder.getContext();
  8. if (context != null) { %>
  9. Context on ContextHolder is of type: <%= context.getClass().getName() %><BR><BR>
  10. <% if (context instanceof SecureContext) { %>
  11. The Context implements SecureContext.<BR><BR>
  12. <% SecureContext sc = (SecureContext) context;
  13. Authentication auth = sc.getAuthentication();
  14. if (auth != null) { %>
  15. Authentication object is of type: <%= auth.getClass().getName() %><BR><BR>
  16. Authentication object as a String: <%= auth.toString() %><BR><BR>
  17. Authentication object holds the following granted authorities:<BR><BR>
  18. <% GrantedAuthority[] granted = auth.getAuthorities();
  19. for (int i = 0; i < granted.length; i++) { %>
  20. <%= granted[i].toString() %> (getAuthority(): <%= granted[i].getAuthority() %>)<BR>
  21. <% }
  22. if (auth instanceof AuthByAdapter) { %>
  23. <BR><B>SUCCESS! Your container adapter appears to be properly configured!</B><BR><BR>
  24. <% } else { %>
  25. <BR><I>WARNING: Authentication object does not implement AuthByAdapter</I><BR>
  26. This may point to an error with your adapter configuration, although can be ignored if intentional.<BR><BR>
  27. <% }
  28. } else { %>
  29. Authentication object is null.<BR>
  30. This is an error and your container adapter will not operate properly until corrected.<BR><BR>
  31. <% }
  32. } else { %>
  33. <B>ContextHolder does not contain a SecureContext.</B><BR>
  34. This is an error and your container adapter will not operate properly until corrected.<BR><BR>
  35. <% }
  36. } else { %>
  37. <B>ContextHolder on ContextHolder is null.</B><BR>
  38. This indicates improper setup of the container adapter. Refer to the reference documentation.<BR>
  39. Also ensure the correct subclass of AbstractMvcIntegrationInterceptor is being used for your container.<BR>
  40. <%}
  41. %>