Foros de discusión
exception handling in jsf portlets
Eric Soucy, modificado hace 9 años.
exception handling in jsf portlets
Junior Member Mensajes: 65 Fecha de incorporación: 21/01/14 Mensajes recientes
Hi,
I wish to handle exceptions using a ExceptionHandlerFactory and my custom ExceptionHandler (as described in jsf2 spec).
I simply want to log the exception and redirect to an error view.
It works fine except if the exception happens during the render response phase. Then the redirection won't work since the response is already commited.
I read that I would need a filter to do that.
What is the best practice for handling exceptions with jsf portlets in liferay?
Thank you
Eric
I wish to handle exceptions using a ExceptionHandlerFactory and my custom ExceptionHandler (as described in jsf2 spec).
I simply want to log the exception and redirect to an error view.
It works fine except if the exception happens during the render response phase. Then the redirection won't work since the response is already commited.
I read that I would need a filter to do that.
What is the best practice for handling exceptions with jsf portlets in liferay?
Thank you
Eric
Vassilis Petropoulos, modificado hace 9 años.
RE: exception handling in jsf portlets
Junior Member Mensajes: 26 Fecha de incorporación: 10/04/12 Mensajes recientes
hi,
i am using this for ajax requests:
((MimeResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse()).resetBuffer();
FacesContext.getCurrentInstance().getExternalContext().redirect(''/error.xhtml");
i am using this for ajax requests:
((MimeResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse()).resetBuffer();
FacesContext.getCurrentInstance().getExternalContext().redirect(''/error.xhtml");