webtier@glassfish.java.net

Re: What is the recommended way to catch exceptions and display an error page?

From: <webtier_at_javadesktop.org>
Date: Thu, 04 Feb 2010 16:26:48 PST

After further research, I've answered my own question.

I found this article: http://weblogs.java.net/blog/edburns/archive/2009/09/03/dealing-gracefully-viewexpiredexception-jsf2 . Doesn't exactly solve what I am trying to do, but the hooks allow me to do it. Instead of inspecting only certain exceptions and passing the rest on, I catch all exceptions, pass them onto my error page and then swallow them. This means that I can redirect to a JSF error page.

The code's a bit ugly, but I only have to write it once per project.

I also read somewhere that this area is something being considered for a future release of JSF2 (probably 2.1 I guess).
[Message sent by forum member 'hirowla' (ian.rowlands_at_three.com.au)]

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