Package org.apache.struts2.dispatcher.filter

# Class StrutsPrepareFilter

java.lang.Object
org.apache.struts2.dispatcher.filter.StrutsPrepareFilter

All Implemented Interfaces:
  `jakarta.servlet.Filter`, `StrutsStatics`

public class StrutsPrepareFilter extends Object implements StrutsStatics, jakarta.servlet.Filter
Prepares the request for execution by a later `StrutsExecuteFilter` filter instance.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected PrepareOperations`
  `prepare`
  `protected static final String`
  `REQUEST_EXCLUDED_FROM_ACTION_MAPPING`

  ### Fields inherited from interface org.apache.struts2.StrutsStatics

  `ACTION_MAPPING, HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StrutsPrepareFilter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected InitOperations`
  `createInitOperations()`
  Creates a new instance of `InitOperations` to be used during initialising `Dispatcher`
  `protected PrepareOperations`
  `createPrepareOperations(Dispatcher dispatcher)`
  Creates a new instance of `PrepareOperations` to be used during initialising `Dispatcher`
  `void`
  `destroy()`
  `void`
  `doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain)`
  `void`
  `init(jakarta.servlet.FilterConfig filterConfig)`
  `protected void`
  `postInit(Dispatcher dispatcher, jakarta.servlet.FilterConfig filterConfig)`
  Callback for post initialization

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

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

- ## Field Details

  - ### REQUEST_EXCLUDED_FROM_ACTION_MAPPING

    protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING

  - ### prepare

    protected PrepareOperations prepare

- ## Constructor Details

  - ### StrutsPrepareFilter

    public StrutsPrepareFilter()

- ## Method Details

  - ### init

    public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException
    Specified by:
      `init` in interface `jakarta.servlet.Filter`
    Throws:
      `jakarta.servlet.ServletException`

  - ### createInitOperations

    protected InitOperations createInitOperations()
    Creates a new instance of `InitOperations` to be used during initialising `Dispatcher`
    Returns:
      instance of `InitOperations`

  - ### createPrepareOperations

    protected PrepareOperations createPrepareOperations(Dispatcher dispatcher)
    Creates a new instance of `PrepareOperations` to be used during initialising `Dispatcher`
    Returns:
      instance of `PrepareOperations`

  - ### postInit

    protected void postInit(Dispatcher dispatcher, jakarta.servlet.FilterConfig filterConfig)
    Callback for post initialization
    Parameters:
      `dispatcher` - the dispatcher
      `filterConfig` - the filter config

  - ### doFilter

    public void doFilter(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
    Specified by:
      `doFilter` in interface `jakarta.servlet.Filter`
    Throws:
      `IOException`
      `jakarta.servlet.ServletException`

  - ### destroy

    public void destroy()
    Specified by:
      `destroy` in interface `jakarta.servlet.Filter`