You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Andrea Paternesi <pa...@hotmail.it> on 2008/10/01 14:41:05 UTC
problem with ViewHandlerException
Hi all,
i am new here.
I have a problem trying to handling the viewHandlerException.
As proprosed in this blog here http://www.jroller.com/mert/entry/handling_errors_with_an_errror
i made a FacesServer wrapper to trying to catch for ServletException.
Now the main part of the code is this one.
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
try {
delegate.service(request,response);
}
catch(Throwable e) {
redirectToErrorPage((HttpServletRequest) request, (HttpServletResponse) response);
}
}
The main problem here is that Myfaces code for the FacesServlet and in particular the member
handleLifecycleException(FacesContext facesContext, Exception e) throws IOException, ServletException;
handles the exception its own.
if(errorHandlerClass != null) {
..
..
..
}
else {
_ErrorPageWriter.handleException(facesContext, e);
}
it seems to me that the VievHandlerException is handled by the _ErrorPageWriter and the exception is never thrown up.
So the wrapper is almost useless because the exception will never be thrown.
Do you have any ideas or something to cope with this problem?
Thanks for any help you can give to me.
Andrea.
_________________________________________________________________
Comunica, gioca e divertiti con i tuoi amici su Messenger!
http://www.messenger.it
Re: problem with ViewHandlerException
Posted by Leonardo Uribe <lu...@gmail.com>.
On Wed, Oct 1, 2008 at 7:41 AM, Andrea Paternesi <pa...@hotmail.it>wrote:
> Hi all,
>
> i am new here.
> I have a problem trying to handling the viewHandlerException.
>
> As proprosed in this blog here
> http://www.jroller.com/mert/entry/handling_errors_with_an_errror
> i made a FacesServer wrapper to trying to catch for ServletException.
>
> Now the main part of the code is this one.
>
> *public void *service(ServletRequest request, ServletResponse response) *throws
> *ServletException, IOException {
> * try *{
> delegate.service(request,response);
> }
> * catch*(Throwable e) {
> redirectToErrorPage((HttpServletRequest) request,
> (HttpServletResponse) response);
> }
> }
>
> The main problem here is that Myfaces code for the FacesServlet and in
> particular the member
>
> handleLifecycleException(FacesContext facesContext, Exception e) throws
> IOException, ServletException;
>
> handles the exception its own.
>
>
> if(errorHandlerClass != null) {
> ..
> ..
> ..
> }
> else {
> _ErrorPageWriter.handleException(facesContext, e);
> }
>
> it seems to me that the VievHandlerException is handled by the
> _ErrorPageWriter and the exception is never thrown up.
> So the wrapper is almost useless because the exception will never be
> thrown.
>
> Do you have any ideas or something to cope with this problem?
>
The info here http://wiki.apache.org/myfaces/Handling_Server_Errors could
help you.
regards
Leonardo Uribe
>
> Thanks for any help you can give to me.
>
>
> Andrea.
>
> ------------------------------
> Foto, blog, amici. crea il tuo spazio online! C'รจ Spaces!<http://home.services.spaces.live.com/>
>