-
Jan 10th, 2007, 12:16 PM
#1
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
-
Jan 10th, 2007, 02:53 PM
#2
I don't think you know this information, you'd have to code this yourself.
-
Jan 30th, 2007, 12:54 PM
#3
Thanks for the help. I'll take a deeper look into it when I get some more time.
-
Feb 27th, 2007, 11:06 AM
#4
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
-
Forum Rules