Class DefaultRequestExceptionHandler

  • All Implemented Interfaces:
    RequestExceptionHandler

    public class DefaultRequestExceptionHandler
    extends Object
    implements RequestExceptionHandler
    Default implementation of RequestExceptionHandler that displays the standard ExceptionReport page. Similarly to the servlet spec's standard error handling, the default exception handler allows configuring handlers for specific types of exceptions. The error-page/exception-type configuration in web.xml does not work in Tapestry application as errors are wrapped in Tapestry's exception types (see OperationException and ComponentEventException ). Configurations are flexible. You can either contribute a ExceptionHandlerAssistant to use arbitrary complex logic for error handling or a page class to render for the specific exception. Additionally, exceptions can carry context for the error page. Exception context is formed either from the name of Exception (e.g. SmtpNotRespondingException -> ServiceFailure mapping would render a page with URL /servicefailure/smtpnotresponding) or they can implement ContextAwareException interface. If no configured exception type is found, the default exception page SymbolConstants.EXCEPTION_REPORT_PAGE is rendered. This fallback exception page must implement the ExceptionReporter interface.