Class ProxyErrorReportValve

All Implemented Interfaces:
MBeanRegistration, Contained, JmxEnabled, Lifecycle, Valve

public class ProxyErrorReportValve extends ErrorReportValve

Implementation of a Valve that proxies or redirects error reporting to other urls.

This Valve should be attached at the Host level, although it will work if attached to a Context.

  • Field Details

    • useRedirect

      protected boolean useRedirect
      Use a redirect or proxy the response to the specified location. Default to not redirect.
    • usePropertiesFile

      protected boolean usePropertiesFile
      Use a properties file for the URLs.
  • Constructor Details

    • ProxyErrorReportValve

      public ProxyErrorReportValve()
      Default constructor.
  • Method Details

    • getUseRedirect

      public boolean getUseRedirect()
      Returns whether a redirect is used to send the error report to the specified location.
      Returns:
      true if a redirect is used, false if a proxy is used
    • setUseRedirect

      public void setUseRedirect(boolean useRedirect)
      Sets whether to use a redirect or proxy for the error report.
      Parameters:
      useRedirect - true to use a redirect, false to use a proxy
    • getUsePropertiesFile

      public boolean getUsePropertiesFile()
      Returns whether a properties file is used to determine the redirect URLs.
      Returns:
      true if a properties file is used, false otherwise
    • setUsePropertiesFile

      public void setUsePropertiesFile(boolean usePropertiesFile)
      Sets whether to use a properties file for the redirect URLs.
      Parameters:
      usePropertiesFile - true to use a properties file, false otherwise
    • report

      protected void report(Request request, Response response, Throwable throwable)
      Reports the error by redirecting or proxying to the configured error URL.
      Overrides:
      report in class ErrorReportValve
      Parameters:
      request - the servlet request
      response - the servlet response
      throwable - the exception that caused the error, or null