You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Pa...@anicasystem.com.pl on 2007/07/31 14:38:59 UTC

Custom error handler and ajax requests (a4j)

Hi,
I made my own error handler (works like the one described here: 
http://wiki.apache.org/myfaces/Handling_Server_Errors) . 
In the backing bean I use following lines to fetch the exception 
details....

        FacesContext context = FacesContext.getCurrentInstance();
        Map requestMap = context.getExternalContext().getRequestMap();
        Throwable ex = (Throwable) 
requestMap.get("javax.servlet.error.exception");

And everything works fine when an error occurs during standard request 
(eg. when h:commandButton calls a method that throws exception).
But when I switch to ajax4jsf and use a4j:commandButton, requestMap 
contains no information about exceptions...
Does anybody know, how to dig to this exception when using ajax4jsf 
components? 

-- 
Regards
Paweł Czerwiński
pawel.czerwinski@anicasystem.com.pl


Re: Custom error handler and ajax requests (a4j)

Posted by Pa...@anicasystem.com.pl.
Anybody? :>

-- 
Regards
Paweł Czerwiński



Pawel.Czerwinski@anicasystem.com.pl wrote on 2007-07-31 14:38:59:

> 
> Hi, 
> I made my own error handler (works like the one described here: 
> http://wiki.apache.org/myfaces/Handling_Server_Errors) . 
> In the backing bean I use following lines to fetch the exception 
details.... 
> 
>         FacesContext context = FacesContext.getCurrentInstance(); 
>         Map requestMap = context.getExternalContext().getRequestMap(); 
>         Throwable ex = (Throwable) requestMap.get("javax.servlet.
> error.exception"); 
> 
> And everything works fine when an error occurs during standard 
> request (eg. when h:commandButton calls a method that throws exception). 

> But when I switch to ajax4jsf and use a4j:commandButton, requestMap 
> contains no information about exceptions... 
> Does anybody know, how to dig to this exception when using ajax4jsf 
> components? 
> 
> -- 
> Regards
> Paweł Czerwiński
> pawel.czerwinski@anicasystem.com.pl