final Iterator<ExceptionQueuedEvent> iterator = this.getUnhandledExceptionQueuedEvents().iterator();
while (iterator.hasNext()) {
- ExceptionQueuedEvent event = iterator.next();
- ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();
+ final ExceptionQueuedEvent event = iterator.next();
+ final ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();
- // get the exception from context
- Throwable t = context.getException();
+ // Get the exception from context
+ final Throwable t = context.getException();
final FacesContext facesContext = FacesContext.getCurrentInstance();
final Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
final NavigationHandler nav = facesContext.getApplication().getNavigationHandler();
- //here you do what ever you want with exception
+ // Here you do what ever you want with exception
try {
-
- //log error ?
+ // Log error ?
this.loggerBeanLocal.logFatal("Critical Exception.", t); //NOI18N
- //redirect error page
+ // Redirect error page
requestMap.put("exceptionMessage", t.getMessage()); //NOI18N
nav.handleNavigation(facesContext, null, "exception"); //NOI18N
facesContext.renderResponse();
- // remove the comment below if you want to report the error in a jsf error message
+ // Remove the comment below if you want to report the error in a jsf error message
// @TODO: JsfUtil.addErrorMessage(t.getMessage());
} finally {
- //remove it from queue
+ // Remove it from queue
iterator.remove();
}
}
- //parent hanle
+ // Parent hanle
this.getWrapped().handle();
}