org.apache.catalina.Context.findErrorPage()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(11.6k)|赞(0)|评价(0)|浏览(113)

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

Context.findErrorPage介绍

[英]Return the error page entry for the specified HTTP error code, if any; otherwise return null.
[中]返回指定HTTP错误代码的错误页条目(如果有);否则返回null

代码示例

代码示例来源:origin: OryxProject/oryx

private static void doTestServingLayer(Config config) throws IOException {
 try (ServingLayer servingLayer = new ServingLayer(config)) {
  servingLayer.start();
  Context context = servingLayer.getContext();
  assertNotNull(context.findErrorPage(500));
  assertEquals(0, context.getApplicationLifecycleListeners().length);
  assertNotNull(context.findParameter(ConfigUtils.class.getName() + ".serialized"));
  assertNotNull(context.getName());
  assertGreaterOrEqual(Double.parseDouble(context.getWebappVersion()), 3.1);
 }
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Find and return the ErrorPage instance for the specified exception's
 * class, or an ErrorPage instance for the closest superclass for which
 * there is such a definition.  If no associated ErrorPage instance is
 * found, return <code>null</code>.
 *
 * @param context The Context in which to search
 * @param exception The exception for which to find an ErrorPage
 */
private static ErrorPage findErrorPage
  (Context context, Throwable exception) {
  if (exception == null)
    return (null);
  Class<?> clazz = exception.getClass();
  String name = clazz.getName();
  while (!Object.class.equals(clazz)) {
    ErrorPage errorPage = context.findErrorPage(name);
    if (errorPage != null)
      return (errorPage);
    clazz = clazz.getSuperclass();
    if (clazz == null)
      break;
    name = clazz.getName();
  }
  return (null);
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Return the error page entry for the specified Java exception type,
 * if any; otherwise return <code>null</code>.
 *
 * @param exceptionType Exception type to look up
 * @return a string representation of the error page
 * @throws MBeanException propagated from the managed resource access
 * @deprecated Unused. Will be removed in Tomcat 10.
 *             Use {@link #findErrorPage(Throwable)} instead.
 */
@Deprecated
public String findErrorPage(String exceptionType) throws MBeanException {
  Context context = doGetManagedResource();
  return context.findErrorPage(exceptionType).toString();
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Return the error page entry for the specified Java exception type,
 * if any; otherwise return <code>null</code>.
 *
 * @param exceptionType Exception type to look up
 * @return a string representation of the error page
 * @throws MBeanException propagated from the managed resource access
 * @deprecated Unused. Will be removed in Tomcat 10.
 *             Use {@link #findErrorPage(Throwable)} instead.
 */
@Deprecated
public String findErrorPage(String exceptionType) throws MBeanException {
  Context context = doGetManagedResource();
  return context.findErrorPage(exceptionType).toString();
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Return the error page entry for the specified HTTP error code,
 * if any; otherwise return <code>null</code>.
 *
 * @param errorCode Error code to look up
 * @return a string representation of the error page
 * @throws MBeanException propagated from the managed resource access
 */
public String findErrorPage(int errorCode) throws MBeanException {
  Context context = doGetManagedResource();
  return context.findErrorPage(errorCode).toString();
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Return the error page entry for the specified Java exception type,
 * if any; otherwise return <code>null</code>.
 *
 * @param exceptionType Exception type to look up
 * @return a string representation of the error page
 * @throws MBeanException propagated from the managed resource access
 */
public String findErrorPage(Throwable exceptionType) throws MBeanException {
  Context context = doGetManagedResource();
  return context.findErrorPage(exceptionType).toString();
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Return the error page entry for the specified Java exception type,
 * if any; otherwise return <code>null</code>.
 *
 * @param exceptionType Exception type to look up
 * @return a string representation of the error page
 * @throws MBeanException propagated from the managed resource access
 */
public String findErrorPage(Throwable exceptionType) throws MBeanException {
  Context context = doGetManagedResource();
  return context.findErrorPage(exceptionType).toString();
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Return the error page entry for the specified HTTP error code,
 * if any; otherwise return <code>null</code>.
 *
 * @param errorCode Error code to look up
 * @return a string representation of the error page
 * @throws MBeanException propagated from the managed resource access
 */
public String findErrorPage(int errorCode) throws MBeanException {
  Context context = doGetManagedResource();
  return context.findErrorPage(errorCode).toString();
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Return the error page entry for the specified HTTP error code,
 * if any; otherwise return <code>null</code>.
 *
 * @param errorCode Error code to look up
 */
public String findErrorPage(int errorCode) throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  return context.findErrorPage(errorCode).toString();
  
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Return the error page entry for the specified HTTP error code,
 * if any; otherwise return <code>null</code>.
 *
 * @param errorCode Error code to look up
 */
public String findErrorPage(int errorCode) throws MBeanException {
  Context context;
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  return context.findErrorPage(errorCode).toString();
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Return the error page entry for the specified Java exception type,
 * if any; otherwise return <code>null</code>.
 *
 * @param exceptionType Exception type to look up
 */
public String findErrorPage(String exceptionType) throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  return context.findErrorPage(exceptionType).toString();
  
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Return the error page entry for the specified Java exception type,
 * if any; otherwise return <code>null</code>.
 *
 * @param exceptionType Exception type to look up
 */
public String findErrorPage(String exceptionType) throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  return context.findErrorPage(exceptionType).toString();
  
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Return the error page entry for the specified HTTP error code,
 * if any; otherwise return <code>null</code>.
 *
 * @param errorCode Error code to look up
 */
public String findErrorPage(int errorCode) throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  return context.findErrorPage(errorCode).toString();
  
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Return the error page entry for the specified HTTP error code,
 * if any; otherwise return <code>null</code>.
 *
 * @param errorCode Error code to look up
 */
public String findErrorPage(int errorCode) throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  return context.findErrorPage(errorCode).toString();
  
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Return the error page entry for the specified HTTP error code,
 * if any; otherwise return <code>null</code>.
 *
 * @param errorCode Error code to look up
 */
public String findErrorPage(int errorCode) throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  return context.findErrorPage(errorCode).toString();
  
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Return the error page entry for the specified HTTP error code,
 * if any; otherwise return <code>null</code>.
 *
 * @param errorCode Error code to look up
 */
public String findErrorPage(int errorCode) throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  return context.findErrorPage(errorCode).toString();
  
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * Return the error page entry for the specified Java exception type,
 * if any; otherwise return <code>null</code>.
 *
 * @param exceptionType Exception type to look up
 */
public String findErrorPage(String exceptionType) throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  return context.findErrorPage(exceptionType).toString();
  
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Return the error page entry for the specified Java exception type,
 * if any; otherwise return <code>null</code>.
 *
 * @param exceptionType Exception type to look up
 */
public String findErrorPage(String exceptionType) throws MBeanException {
  Context context;
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  return context.findErrorPage(exceptionType).toString();
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Return the error page entry for the specified Java exception type,
 * if any; otherwise return <code>null</code>.
 *
 * @param exceptionType Exception type to look up
 */
public String findErrorPage(String exceptionType) throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  return context.findErrorPage(exceptionType).toString();
  
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Return the error page entry for the specified Java exception type,
 * if any; otherwise return <code>null</code>.
 *
 * @param exceptionType Exception type to look up
 */
public String findErrorPage(String exceptionType) throws MBeanException {
  Context context; 
  try {
    context = (Context)getManagedResource();
  } catch (InstanceNotFoundException e) {
    throw new MBeanException(e);
  } catch (RuntimeOperationsException e) {
    throw new MBeanException(e);
  } catch (InvalidTargetObjectTypeException e) {
    throw new MBeanException(e);
  }
  
  return context.findErrorPage(exceptionType).toString();
  
}

相关文章

微信公众号

最新文章

更多

Context类方法