You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ognjen Blagojevic <og...@etf.bg.ac.yu> on 2008/02/19 12:59:25 UTC

[core] Custom error handling in MyFaces 1.2.2

Hi all,

I am trying to override MyFaces error handling for certain exceptions, 
and for others to use the default one. Is it possible?

I was thinking write my custom error handler, with method

public void handleException(FacesContext fc, Exception ex) {
     if (ex instanceof CertainException) {
        // do my handling
     } else {
        return DefaultErrorHandler.handleException(fc, ex);
     }
}

However, I don't know which one is default error handling class? I 
searched MyFaces jars, but coudn't find any public handleException method.

Regards,
Ognjen

Re: [core] Custom error handling in MyFaces 1.2.2

Posted by Ognjen Blagojevic <og...@etf.bg.ac.yu>.
Not much. I am able to write my own error handler (as described on the 
link you provided), but I dont know how to call default error handler 
from it.


Andrew Robinson wrote:
> This help?
> http://wiki.apache.org/myfaces/Handling_Server_Errors
> 
> On Feb 19, 2008 4:59 AM, Ognjen Blagojevic <og...@etf.bg.ac.yu> wrote:
>> Hi all,
>>
>> I am trying to override MyFaces error handling for certain exceptions,
>> and for others to use the default one. Is it possible?
>>
>> I was thinking write my custom error handler, with method
>>
>> public void handleException(FacesContext fc, Exception ex) {
>>      if (ex instanceof CertainException) {
>>         // do my handling
>>      } else {
>>         return DefaultErrorHandler.handleException(fc, ex);
>>      }
>> }
>>
>> However, I don't know which one is default error handling class? I
>> searched MyFaces jars, but coudn't find any public handleException method.
>>
>> Regards,
>> Ognjen
>>
> 


Re: [core] Custom error handling in MyFaces 1.2.2

Posted by Andrew Robinson <an...@gmail.com>.
This help?
http://wiki.apache.org/myfaces/Handling_Server_Errors

On Feb 19, 2008 4:59 AM, Ognjen Blagojevic <og...@etf.bg.ac.yu> wrote:
> Hi all,
>
> I am trying to override MyFaces error handling for certain exceptions,
> and for others to use the default one. Is it possible?
>
> I was thinking write my custom error handler, with method
>
> public void handleException(FacesContext fc, Exception ex) {
>      if (ex instanceof CertainException) {
>         // do my handling
>      } else {
>         return DefaultErrorHandler.handleException(fc, ex);
>      }
> }
>
> However, I don't know which one is default error handling class? I
> searched MyFaces jars, but coudn't find any public handleException method.
>
> Regards,
> Ognjen
>