users@glassfish.java.net

Re: web.xml error-page: How to prevent wrapping in ServletException

From: <glassfish_at_javadesktop.org>
Date: Sat, 07 Aug 2010 03:17:28 PDT

I don't entirely follow the original post however, I think the main thing I found out
when struggling with this myself was that the exception-type mechanism doesn't
work if you've got PROJECT_STATE set to Development (only Production). I don't think this is well documented but it was this that had me going round in circles for days.

In the end I used a custom exception handler factory to gracefully handle
ViewExpiredExceptions and for any other exceptions I'd force navigation to the
error page, although this prevents the useful facelets error page from being used
so I've disabled this feature (customer exception handler) during development.

I did come across an @ApplicationException that's supported by the EJB
container although I don't think I got any useful results from my limited tests.

All in all error handling is an area that needs to be further improved, I have to
test each individual error situation to ensure that the user is getting the right
response and that's a lot of overhead.

Regards,
Brendan.
[Message sent by forum member 'healeyb']

http://forums.java.net/jive/thread.jspa?messageID=479585