I agree that this is useful, but should _not_ be in core.
It's nothing new, however, the Seam framework has a nice, robust
implementation of a very similar feature:
http://docs.jboss.com/seam/2.1.0.A1/reference/en/html/events.html#d0e4418
If you choose to copy that effort, please make sure that is does not
interfere with Seam's (or any other framework's) error handling.
Leonardo Uribe wrote:
On Sat, Jul 5, 2008 at 5:35 AM, Mario Ivankovits <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Hi!
One possible enhancement to the error handling feature of
myfaces could be the capability of redirect to a jsf page.
Any concrete use-case for this, or just yet another
"cool-we-can-make-it" thingy? ;-)
The idea could be create a custom exception hierarchy for a selected
app. Then use the previous idea to define how to manage each exception
properly.
When you do custom apps, it is common to handle this type of exceptions
on the beans and take the proper actions inside it. This proposal could
make easier handle this scenarios (Think on the possible alternatives of
a custom action between several pages, example: a page to query some
data and if no data found throw DataNotFoundException, so redirect to a
page xxx or something like that).
Obviously, there are other alternatives to do the same (handle errors).
But the only way to know which option is better is trial and error.
This feature could be on sandbox (after all, this is the place for trial
and error). But I'm not very sure about this idea, maybe let it in
another place.
Seriously, what's wrong with the error page capabilities of the
webapp container?
Instead of error-code you can have error-type. Never used, tough.
Probably it would be enough to learn the Faces-Servlet to unwrap the
real exception instead of introduce another error handling stuff.
Even this I'd do with a Faces-Servlet wrapper, more like a general
purpose exception-unwrapper-servlet so that this can work with
Mojarra and whatever.
Ciao,
Mario