Class PrimeExceptionHandler
- java.lang.Object
-
- javax.faces.context.ExceptionHandler
-
- javax.faces.context.ExceptionHandlerWrapper
-
- org.primefaces.application.exceptionhandler.PrimeExceptionHandler
-
- All Implemented Interfaces:
EventListener
,javax.faces.event.FacesListener
,javax.faces.event.SystemEventListener
,javax.faces.FacesWrapper<javax.faces.context.ExceptionHandler>
public class PrimeExceptionHandler extends javax.faces.context.ExceptionHandlerWrapper
-
-
Constructor Summary
Constructors Constructor Description PrimeExceptionHandler(javax.faces.context.ExceptionHandler wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Throwable
buildView(javax.faces.context.FacesContext context, Throwable throwable, Throwable rootCause)
Builds the view if not already available.protected String
constructRedirectUrl(javax.faces.context.FacesContext facesContext, String errorPage)
protected ExceptionInfo
createExceptionInfo(Throwable rootCause)
protected String
evaluateErrorPage(Map<String,String> errorPages, Throwable rootCause)
protected AjaxExceptionHandler
findHandlerComponent(javax.faces.context.FacesContext context, Throwable rootCause)
Finds the properAjaxExceptionHandler
for the givenThrowable
.Throwable
getRootCause(Throwable throwable)
javax.faces.context.ExceptionHandler
getWrapped()
void
handle()
protected void
handleAjaxException(javax.faces.context.FacesContext context, Throwable rootCause, ExceptionInfo info)
protected void
handleRedirect(javax.faces.context.FacesContext context, Throwable rootCause, ExceptionInfo info, boolean responseResetted)
protected boolean
isLogException(javax.faces.context.FacesContext context, Throwable rootCause)
protected void
logException(Throwable rootCause)
-
-
-
Method Detail
-
getWrapped
public javax.faces.context.ExceptionHandler getWrapped()
- Specified by:
getWrapped
in interfacejavax.faces.FacesWrapper<javax.faces.context.ExceptionHandler>
- Overrides:
getWrapped
in classjavax.faces.context.ExceptionHandlerWrapper
-
handle
public void handle() throws javax.faces.FacesException
- Overrides:
handle
in classjavax.faces.context.ExceptionHandlerWrapper
- Throws:
javax.faces.FacesException
-
logException
protected void logException(Throwable rootCause)
-
isLogException
protected boolean isLogException(javax.faces.context.FacesContext context, Throwable rootCause)
-
getRootCause
public Throwable getRootCause(Throwable throwable)
- Overrides:
getRootCause
in classjavax.faces.context.ExceptionHandlerWrapper
-
handleAjaxException
protected void handleAjaxException(javax.faces.context.FacesContext context, Throwable rootCause, ExceptionInfo info) throws IOException
- Throws:
IOException
-
createExceptionInfo
protected ExceptionInfo createExceptionInfo(Throwable rootCause) throws IOException
- Throws:
IOException
-
findHandlerComponent
protected AjaxExceptionHandler findHandlerComponent(javax.faces.context.FacesContext context, Throwable rootCause)
Finds the properAjaxExceptionHandler
for the givenThrowable
.- Parameters:
context
- TheFacesContext
.rootCause
- The occurredThrowable
.- Returns:
- The
AjaxExceptionHandler
ornull
.
-
buildView
protected Throwable buildView(javax.faces.context.FacesContext context, Throwable throwable, Throwable rootCause) throws IOException
Builds the view if not already available. This is mostly required for ViewExpiredException's.- Parameters:
context
- TheFacesContext
.throwable
- The occurredThrowable
.rootCause
- The root cause.- Returns:
- The unwrapped
Throwable
. - Throws:
IOException
- If building the view fails.
-
handleRedirect
protected void handleRedirect(javax.faces.context.FacesContext context, Throwable rootCause, ExceptionInfo info, boolean responseResetted) throws IOException
- Throws:
IOException
-
constructRedirectUrl
protected String constructRedirectUrl(javax.faces.context.FacesContext facesContext, String errorPage)
-
-