Results 1 to 4 of 4

Thread: Upon AccessDeniedException Get URL Accessed

  1. #1

    Default Upon AccessDeniedException Get URL Accessed

    Hi all,

    I have setup Acegi, but when I get an AccessDeniedException and the handler calls the configured JSP page, I would like to know what URL caused the problem. Is this available in the active scope of the SecurityContext? The call to request.getRequestURL() or getRequestURI() only returns the name of the JSP that I have configured to handle the exception.

    Thanks,
    Julian

  2. #2
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    I don't think you know this information, you'd have to code this yourself.

  3. #3

    Default

    Thanks for the help. I'll take a deeper look into it when I get some more time.

  4. #4

    Default

    Ok, getting back to this it seems one has to implement the org.acegisecurity.ui.AccessDeniedHandler interface or override the actual implementation class being used (AccessDeniedHandlerImpl). Inside the implementation one can get access to the necessary information then implement home grown logic (prob not recommended) or call the acegi superclass' handle method (making sure to call the superclass after doing nec. work since the superclass commits the response). Once done, make sure to configure the handler in the Spring XML configuration if using Acegi within Spring (prob the handler for an ExceptionTranslationFilter). Pretty straightforward, hth

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •