From: Roland Haeder Date: Tue, 12 Apr 2016 15:31:16 +0000 (+0200) Subject: renamed variable as no shortening takes place here + changed navigation outcome to... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1a02ca19ffa66ddbd4d48db6143d3f0b097c1731;p=jcore-utils.git renamed variable as no shortening takes place here + changed navigation outcome to "exception" --- diff --git a/src/org/mxchange/jcoreee/exceptions/CustomExceptionHandler.java b/src/org/mxchange/jcoreee/exceptions/CustomExceptionHandler.java index 3df048b..856c170 100644 --- a/src/org/mxchange/jcoreee/exceptions/CustomExceptionHandler.java +++ b/src/org/mxchange/jcoreee/exceptions/CustomExceptionHandler.java @@ -90,18 +90,18 @@ public class CustomExceptionHandler extends ExceptionHandlerWrapper { @Override public void handle () throws FacesException { - final Iterator i = this.getUnhandledExceptionQueuedEvents().iterator(); + final Iterator iterator = this.getUnhandledExceptionQueuedEvents().iterator(); - while (i.hasNext()) { - ExceptionQueuedEvent event = i.next(); + while (iterator.hasNext()) { + ExceptionQueuedEvent event = iterator.next(); ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); // get the exception from context Throwable t = context.getException(); - final FacesContext fc = FacesContext.getCurrentInstance(); - final Map requestMap = fc.getExternalContext().getRequestMap(); - final NavigationHandler nav = fc.getApplication().getNavigationHandler(); + final FacesContext facesContext = FacesContext.getCurrentInstance(); + final Map requestMap = facesContext.getExternalContext().getRequestMap(); + final NavigationHandler nav = facesContext.getApplication().getNavigationHandler(); //here you do what ever you want with exception try { @@ -111,14 +111,14 @@ public class CustomExceptionHandler extends ExceptionHandlerWrapper { //redirect error page requestMap.put("exceptionMessage", t.getMessage()); //NOI18N - nav.handleNavigation(fc, null, "/error"); //NOI18N - fc.renderResponse(); + nav.handleNavigation(facesContext, null, "exception"); //NOI18N + facesContext.renderResponse(); // 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 - i.remove(); + iterator.remove(); } }