javax.faces.context.ExceptionHandler.handle()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中javax.faces.context.ExceptionHandler.handle()方法的一些代码示例,展示了ExceptionHandler.handle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExceptionHandler.handle()方法的具体详情如下:
包路径:javax.faces.context.ExceptionHandler
类名称:ExceptionHandler
方法名:handle

ExceptionHandler.handle介绍

[英]Take action to handle the Exception instances residing inside the ExceptionQueuedEvent instances that have been queued by calls to Application().publishEvent(ExceptionQueuedEvent.class, *eventContext*). The requirements of the default implementation are detailed in section JSF.6.2.1.
[中]采取操作以处理ExceptionQueuedEvent实例中驻留的Exception实例,这些实例已由对Application().publishEvent(ExceptionQueuedEvent.class, *eventContext*)的调用排队。默认实现的需求在JSF部分中有详细说明。6.2.1.

代码示例

代码示例来源:origin: stackoverflow.com

try {
  // some code
} catch (Throwable e) {
  ExceptionHandler handler = handlers.get(e.getClass());
  if (handler != null) handler.handle(e);
  else DEFAULT_HANDLER.handle(e);
}
// to be continued

代码示例来源:origin: javax/javaee-web-api

/**
 * <p>The default behavior of this method is to
 * call {@link javax.faces.context.ExceptionHandler#handle()}
 * on the wrapped {@link ExceptionHandler} object.</p>
 *
 * @see javax.faces.context.ExceptionHandler#handle()
 */
@Override
public void handle() throws FacesException {
  getWrapped().handle();
}

代码示例来源:origin: com.sun.faces/jsf-api

/**
 * <p>The default behavior of this method is to
 * call {@link javax.faces.context.ExceptionHandler#handle()}
 * on the wrapped {@link ExceptionHandler} object.</p>
 *
 * @see javax.faces.context.ExceptionHandler#handle()
 */
@Override
public void handle() throws FacesException {
  getWrapped().handle();
}

代码示例来源:origin: org.apache.myfaces.core/myfaces-api

@Override
public void handle() throws FacesException
{
  getWrapped().handle();
}

代码示例来源:origin: eclipse-ee4j/mojarra

/**
 * <p>The default behavior of this method is to
 * call {@link javax.faces.context.ExceptionHandler#handle()}
 * on the wrapped {@link ExceptionHandler} object.</p>
 *
 * @see javax.faces.context.ExceptionHandler#handle()
 */
@Override
public void handle() throws FacesException {
  getWrapped().handle();
}

代码示例来源:origin: eclipse-ee4j/mojarra

/**
 * <p>The default behavior of this method is to
 * call {@link javax.faces.context.ExceptionHandler#handle()}
 * on the wrapped {@link ExceptionHandler} object.</p>
 *
 * @see javax.faces.context.ExceptionHandler#handle()
 */
@Override
public void handle() throws FacesException {
  getWrapped().handle();
}

代码示例来源:origin: org.glassfish/javax.faces

/**
 * <p>The default behavior of this method is to
 * call {@link javax.faces.context.ExceptionHandler#handle()}
 * on the wrapped {@link ExceptionHandler} object.</p>
 *
 * @see javax.faces.context.ExceptionHandler#handle()
 */
@Override
public void handle() throws FacesException {
  getWrapped().handle();
}

代码示例来源:origin: javax.faces/javax.faces-api

/**
 * <p>The default behavior of this method is to
 * call {@link javax.faces.context.ExceptionHandler#handle()}
 * on the wrapped {@link ExceptionHandler} object.</p>
 *
 * @see javax.faces.context.ExceptionHandler#handle()
 */
@Override
public void handle() throws FacesException {
  getWrapped().handle();
}

代码示例来源:origin: jboss/jboss-javaee-specs

/**
 * <p>The default behavior of this method is to
 * call {@link javax.faces.context.ExceptionHandler#handle()}
 * on the wrapped {@link ExceptionHandler} object.</p>
 *
 * @see javax.faces.context.ExceptionHandler#handle()
 */
@Override
public void handle() throws FacesException {
  getWrapped().handle();
}

代码示例来源:origin: org.jboss.spec.javax.faces/jboss-jsf-api_2.0_spec

/**
 * <p>The default behavior of this method is to
 * call {@link javax.faces.context.ExceptionHandler#handle()}
 * on the wrapped {@link ExceptionHandler} object.</p>
 *
 * @see javax.faces.context.ExceptionHandler#handle()
 */
public void handle() throws FacesException {
  getWrapped().handle();
}

代码示例来源:origin: org.glassfish/jakarta.faces

/**
 * <p>The default behavior of this method is to
 * call {@link javax.faces.context.ExceptionHandler#handle()}
 * on the wrapped {@link ExceptionHandler} object.</p>
 *
 * @see javax.faces.context.ExceptionHandler#handle()
 */
@Override
public void handle() throws FacesException {
  getWrapped().handle();
}

代码示例来源:origin: org.apache.myfaces.tobago/tobago-jsf-compat

public static void handleExceptions(FacesContext facesContext) {
 facesContext.getExceptionHandler().handle();
}

代码示例来源:origin: com.github.adminfaces/admin-template

@Override
public void handle() throws FacesException {
  FacesContext context = FacesContext.getCurrentInstance();
  findErrorMessages(context);
  handleException(context);
  wrapped.handle();
}

代码示例来源:origin: adminfaces/admin-template

@Override
public void handle() throws FacesException {
  FacesContext context = FacesContext.getCurrentInstance();
  findErrorMessages(context);
  handleException(context);
  wrapped.handle();
}

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-jsf

@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();
  }
}

代码示例来源:origin: br.gov.frameworkdemoiselle/demoiselle-jsf

@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();
  }
}

代码示例来源:origin: org.omnifaces/omnifaces

/**
 * Set every exception as a global FATAL faces message.
 */
@Override
public void handle() {
  for (Iterator<ExceptionQueuedEvent> iter = getUnhandledExceptionQueuedEvents().iterator(); iter.hasNext();) {
    addGlobal(new FacesMessage(SEVERITY_FATAL, createFatalMessage(iter.next().getContext().getException()), null));
    iter.remove();
  }
  getWrapped().handle();
}

代码示例来源:origin: omnifaces/omnifaces

/**
 * Set every exception as a global FATAL faces message.
 */
@Override
public void handle() {
  for (Iterator<ExceptionQueuedEvent> iter = getUnhandledExceptionQueuedEvents().iterator(); iter.hasNext();) {
    addGlobal(new FacesMessage(SEVERITY_FATAL, createFatalMessage(iter.next().getContext().getException()), null));
    iter.remove();
  }
  getWrapped().handle();
}

代码示例来源:origin: omnifaces/omnifaces

/**
 * Handle the ajax exception as follows, only and only if the current request is an ajax request with an uncommitted
 * response and there is at least one unhandled exception:
 * <ul>
 *   <li>Find the root cause of the exception by {@link #findExceptionRootCause(FacesContext, Throwable)}.
 *   <li>Find the error page location based on root cause by {@link #findErrorPageLocation(FacesContext, Throwable)}.
 *   <li>Set the standard servlet error request attributes.
 *   <li>Force JSF to render the full error page in its entirety.
 * </ul>
 * Any remaining unhandled exceptions will be swallowed. Only the first one is relevant.
 */
@Override
public void handle() {
  handleAjaxException(getContext());
  getWrapped().handle();
}

代码示例来源:origin: org.omnifaces/omnifaces

/**
 * Handle the ajax exception as follows, only and only if the current request is an ajax request with an uncommitted
 * response and there is at least one unhandled exception:
 * <ul>
 *   <li>Find the root cause of the exception by {@link #findExceptionRootCause(FacesContext, Throwable)}.
 *   <li>Find the error page location based on root cause by {@link #findErrorPageLocation(FacesContext, Throwable)}.
 *   <li>Set the standard servlet error request attributes.
 *   <li>Force JSF to render the full error page in its entirety.
 * </ul>
 * Any remaining unhandled exceptions will be swallowed. Only the first one is relevant.
 */
@Override
public void handle() {
  handleAjaxException(getContext());
  getWrapped().handle();
}

相关文章