tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Len Popp <>
Subject Re: error-page problem - nested exceptions
Date Fri, 22 Jan 2010 16:45:16 GMT
You could have your error handler check if the exception is a
NestedServletException and its getRootCause() is a
UnAuthorisedAccessException, and display the nested exception's error
message in that case. You might want to use a separate <error-page>
for NestedServletException.

On Fri, Jan 22, 2010 at 07:06, rotis23 <> wrote:
> Hi All,
> I use web.xml error-page handlers, some with error-code and other with
> exception-type. At the end I have a catchall error-page that handles
> java.lang.Throwable - users never see a stack trace and the world is a good
> place.
> However, I've recently added a Hibernate security layer that throws a
> UnAuthorisedAccessException that gets wrapped in a Spring
> NestedServletException before it hits the error-page handlers.
> Now I understand that it tries to match the top level Exception in the stack
> first then uses the next nested exception after that and so on until an
> error-page is matched. The problem is that my catchall Throwable is matching
> the NestedServletException first before the wrapped
> UnAuthorisedAccessException hits its error-page handler. I need the users to
> see that they don't have the privleges rather than a generic error messge -
> I also need the catchall!
> Has anyone else dealt with this issue? I've been searchign for a couple days
> on this now.
> TIA, rotis23
> --
> View this message in context:
> Sent from the Tomcat - User mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message