/** * <p class="changed_added_2_0">Return the * <code>ExceptionQueuedEventContext</code> for this event instance.</p> * * @since 2.0 * * @return the context */ public ExceptionQueuedEventContext getContext() { return (ExceptionQueuedEventContext) getSource(); }
/** * <p class="changed_added_2_0">Return the * <code>ExceptionQueuedEventContext</code> for this event instance.</p> * * @since 2.0 * * @return the context */ public ExceptionQueuedEventContext getContext() { return (ExceptionQueuedEventContext) getSource(); }
public ExceptionQueuedEventContext getContext() { return (ExceptionQueuedEventContext)getSource(); } }
/** * <p class="changed_added_2_0">Return the * <code>ExceptionQueuedEventContext</code> for this event instance.</p> * * @since 2.0 * * @return the context */ public ExceptionQueuedEventContext getContext() { return (ExceptionQueuedEventContext) getSource(); }
/** * <p class="changed_added_2_0">Return the * <code>ExceptionQueuedEventContext</code> for this event instance.</p> * * @since 2.0 * * @return the context */ public ExceptionQueuedEventContext getContext() { return (ExceptionQueuedEventContext) getSource(); }
/** * <p class="changed_added_2_0">Return the * <code>ExceptionQueuedEventContext</code> for this event instance.</p> * * @since 2.0 */ public ExceptionQueuedEventContext getContext() { return (ExceptionQueuedEventContext) getSource(); }
/** * <p class="changed_added_2_0">Return the * <code>ExceptionQueuedEventContext</code> for this event instance.</p> * * @since 2.0 */ public ExceptionQueuedEventContext getContext() { return (ExceptionQueuedEventContext) getSource(); }
/** * <p class="changed_added_2_0">Return the * <code>ExceptionQueuedEventContext</code> for this event instance.</p> * * @since 2.0 * * @return the context */ public ExceptionQueuedEventContext getContext() { return (ExceptionQueuedEventContext) getSource(); }
/** * <p class="changed_added_2_0">Return the * <code>ExceptionQueuedEventContext</code> for this event instance.</p> * * @since 2.0 * * @return the context */ public ExceptionQueuedEventContext getContext() { return (ExceptionQueuedEventContext) getSource(); }
/** * <p class="changed_added_2_0">Return the * <code>ExceptionQueuedEventContext</code> for this event instance.</p> * * @since 2.0 * * @return the context */ public ExceptionQueuedEventContext getContext() { return (ExceptionQueuedEventContext) getSource(); }
private static class MyExceptionHandler extends ExceptionHandlerWrapper { private ExceptionHandler parent; public WfExceptionHandler(ExceptionHandler parent) { this.parent = parent; } @Override public ExceptionHandler getWrapped() { return this.parent; } @Override public void handle() throws FacesException { for (Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); i.hasNext();) { ExceptionQueuedEvent event = i.next(); i.remove(); ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); Throwable t = context.getException(); myProcessing(t); } } ... }
@Override public void handle() throws FacesException { Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); while (i.hasNext()) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); // get the exception from context Throwable t = context.getException(); if (NonexistentConversationException.class.isInstance(t)) { i.remove(); throw RuntimeException.class.cast(t); } } delegate.handle(); } }
public void handle() throws FacesException { final Iterator<ExceptionQueuedEvent> i = getUnhandledExceptionQueuedEvents().iterator(); while (i.hasNext()) { ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); Throwable t = context.getException(); final FacesContext fc = FacesContext.getCurrentInstance(); final ExternalContext externalContext = fc.getExternalContext(); final ConfigurableNavigationHandler nav = (ConfigurableNavigationHandler) fc.getApplication().getNavigationHandler(); try { log.error(t.getMessage(), t); performRedirect(externalContext, "/error_service.htm"); fc.renderResponse(); } finally { i.remove(); } } getWrapped().handle(); }
@Override public void handle() throws FacesException { FacesContext facesContext = FacesContext.getCurrentInstance(); ExceptionQueuedEventContext exceptionContext; Throwable root; for (Iterator<ExceptionQueuedEvent> iter = getUnhandledExceptionQueuedEvents().iterator(); iter.hasNext();) { exceptionContext = (ExceptionQueuedEventContext) iter.next().getSource(); root = getRoot(exceptionContext.getException()); if (handleException(root, facesContext)) { iter.remove(); } } if (getUnhandledExceptionQueuedEvents().iterator().hasNext()) { getWrapped().handle(); } }
ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();
ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource();
ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); try { Throwable t = context.getException();
ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event.getSource(); try { Throwable t = context.getException();
ExceptionQueuedEvent event = i.next(); ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event .getSource(); Throwable t = context.getException(); if (t instanceof ViewExpiredException) {
public void handle() throws FacesException { FacesContext fc = FacesContext.getCurrentInstance(); for (Iterator<ExceptionQueuedEvent> iter = getUnhandledExceptionQueuedEvents().iterator(); iter.hasNext(); ) { ExceptionQueuedEvent event = iter.next(); ExceptionQueuedEventContext queueContext = (ExceptionQueuedEventContext) event.getSource(); Throwable ex = queueContext.getException(); //walk back to the original cause of the exception while (ex.getCause() != null) { ex = ex.getCause(); } String redirectURL = mapping.get(ex.getClass()); if (redirectURL != null) { PartialResponseWriter writer = fc.getPartialViewContext().getPartialResponseWriter(); String uri = fc.getApplication().getViewHandler().getResourceURL(fc, redirectURL); try { writer.startDocument(); writer.redirect(uri); writer.endDocument(); fc.responseComplete(); return; } catch (IOException e) { throw new FacesException(e); } } } handler.handle(); }