Package org.apache.struts2.dispatcher

# Class DefaultDispatcherErrorHandler

java.lang.Object
org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler

All Implemented Interfaces:
  `DispatcherErrorHandler`

public class DefaultDispatcherErrorHandler extends Object implements DispatcherErrorHandler
Default implementation of `DispatcherErrorHandler` which sends Error Report in devMode or `HttpServletResponse.sendError(int, java.lang.String)` otherwise.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultDispatcherErrorHandler()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected HashMap<String,Object>`
  `createReportData(Exception e, List<Throwable> chain)`
  `void`
  `handleError(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, int code, Exception e)`
  Handle passed error code or exception
  `protected void`
  `handleErrorInDevMode(jakarta.servlet.http.HttpServletResponse response, int code, Exception e)`
  `void`
  `init(jakarta.servlet.ServletContext ctx)`
  Init instance after creating `Dispatcher`
  `protected void`
  `sendErrorResponse(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, int code, Exception e)`
  `void`
  `setDevMode(String devMode)`
  `void`
  `setFreemarkerManager(FreemarkerManager freemarkerManager)`

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

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

- ## Constructor Details

  - ### DefaultDispatcherErrorHandler

    public DefaultDispatcherErrorHandler()

- ## Method Details

  - ### setFreemarkerManager

    public void setFreemarkerManager(FreemarkerManager freemarkerManager)

  - ### setDevMode

    public void setDevMode(String devMode)

  - ### init

    public void init(jakarta.servlet.ServletContext ctx)
    Description copied from interface: `DispatcherErrorHandler`
    Init instance after creating `Dispatcher`
    Specified by:
      `init` in interface `DispatcherErrorHandler`
    Parameters:
      `ctx` - current `ServletContext`

  - ### handleError

    public void handleError(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, int code, Exception e)
    Description copied from interface: `DispatcherErrorHandler`
    Handle passed error code or exception
    Specified by:
      `handleError` in interface `DispatcherErrorHandler`
    Parameters:
      `request` - current `HttpServletRequest`
      `response` - current `HttpServletResponse`
      `code` - HTTP Error Code, see `HttpServletResponse` for possible error codes
      `e` - Exception to report

  - ### sendErrorResponse

    protected void sendErrorResponse(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, int code, Exception e)

  - ### handleErrorInDevMode

    protected void handleErrorInDevMode(jakarta.servlet.http.HttpServletResponse response, int code, Exception e)

  - ### createReportData

    protected HashMap<String,Object> createReportData(Exception e, List<Throwable> chain)