Package org.apache.tapestry5.internal

# Class FormsRequirePostExceptionHandlerAssistant

java.lang.Object
org.apache.tapestry5.internal.FormsRequirePostExceptionHandlerAssistant

All Implemented Interfaces:
  `ExceptionHandlerAssistant`

public class FormsRequirePostExceptionHandlerAssistant extends Object implements ExceptionHandlerAssistant
Handles `FormsRequirePostException`s (thrown by the `Form` component when the request method was other than post) by redirecting to the page containing the form.

This assistant is contributed to the default `RequestExceptionHandler` service in a way that it is effective only in production mode.

Since:
  5.8.3
See Also:
  - `ExceptionHandlerAssistant`
  - `RequestExceptionHandler`
  - `SymbolConstants.PRODUCTION_MODE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FormsRequirePostExceptionHandlerAssistant(ComponentSource componentSource, PageRenderLinkSource linkSource)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `handleRequestException(Throwable exception, List<Object> exceptionContext)`
  Handles the exception, returning a page class or link to redirect to.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FormsRequirePostExceptionHandlerAssistant

    public FormsRequirePostExceptionHandlerAssistant(ComponentSource componentSource, PageRenderLinkSource linkSource)

- ## Method Details

  - ### handleRequestException

    public Object handleRequestException(Throwable exception, List<Object> exceptionContext) throws IOException
    Description copied from interface: `ExceptionHandlerAssistant`
    Handles the exception, returning a page class or link to redirect to.
    Specified by:
      `handleRequestException` in interface `ExceptionHandlerAssistant`
    Parameters:
      `exception` - the exception as thrown
      `exceptionContext` - a page activation context that is derived from the root-most exception
    Returns:
      either a page class or a `Link`; a page will be redirected to, with the exception context as the page activation context
    Throws:
      `IOException`