# Package org.apache.struts2.dispatcher

This package contains a reimagining of the traditional Struts filter dispatchers.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  ContextAwareDestroyable | Extension of `InternalDestroyable` for components that require `ServletContext` during cleanup (e.g.
  DispatcherErrorHandler | Implementation of this interface is used to handle internal errors or missing resources.
  DispatcherListener | A interface to tag those that want to execute code on the init and destory of a Dispatcher.
  HostConfig | Abstraction for host configuration information such as init params or the servlet context.
  InternalDestroyable | Internal framework interface for components that hold static state (caches, daemon threads, etc.) requiring cleanup during application undeploy to prevent classloader leaks.
  Parameter |
  StaticContentLoader | Interface for loading static resources, based on a path.

- Class Summary
  Class | Description
  --- | ---
  ApplicationMap | A simple implementation of the `Map` interface to handle a collection of attributes and init parameters in a `ServletContext` object.
  AttributeMap | A Map that holds 4 levels of scope.
  ComponentCacheDestroyable | Clears `Component`'s static standard attributes cache to prevent classloader leaks on hot redeploy.
  DefaultActionSupport | A simple action support class that sets properties to be able to serve
  DefaultDispatcherErrorHandler | Default implementation of `DispatcherErrorHandler` which sends Error Report in devMode or `HttpServletResponse.sendError(int, java.lang.String)` otherwise.
  DefaultStaticContentLoader | Default implementation to server static content
  Dispatcher | A utility class the actual dispatcher delegates most of its tasks to.
  Dispatcher.Locator | Provide an accessor class for static XWork utility.
  DispatcherConstants |
  ExecuteOperations | Contains execution operations for filters
  FinalizableReferenceQueueDestroyable | Adapter that exposes `FinalizableReferenceQueue.stopAndClear()` as an `InternalDestroyable` bean, since `FinalizableReferenceQueue` has a private constructor and cannot be directly registered in the container.
  FreemarkerCacheDestroyable | WW-5537: Clears FreeMarker's template and class introspection caches stored in `ServletContext` during application undeploy, preventing classloader leaks.
  HttpParameters |
  HttpParameters.Builder |
  InitOperations | Contains initialization operations
  LocalizedMessage |
  OgnlCacheDestroyable | Clears OGNL runtime caches and JDK introspection caches that hold `Class<?>` references, preventing classloader leaks on hot redeploy.
  Parameter.Empty |
  Parameter.File |
  Parameter.Request |
  PrepareOperations | Contains preparation operations for a request before execution
  RequestMap | A simple implementation of the `Map` interface to handle a collection of request attributes.
  ScopeInterceptorCacheDestroyable | Clears `ScopeInterceptor`'s static locks map to prevent classloader leaks on hot redeploy.
  SessionMap | A simple implementation of the `Map` interface to handle a collection of HTTP session attributes.
  StaticContentLoader.Validator |
  StrutsRequestWrapper | All Struts requests are wrapped with this class, which provides simple JSTL accessibility.

## Package org.apache.struts2.dispatcher Description

This package contains a reimagining of the traditional Struts filter dispatchers. Each specific deployment has their own filters to prevent confusion. In addition, the operations have been explicitly pulled into *Operations objects that try to document through method naming what is happening at every step. Here are a few common use cases and how you would manage the Struts deployment:

### Simple Dispatcher

     <filter>
         <filter-name>struts2</filter-name>
         <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
     </filter>

     <filter-mapping>
         <filter-name>struts2</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>

### Deployment with Sitemesh

     <filter>
         <filter-name>struts2-prepare</filter-name>
         <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareFilter</filter-class>
     </filter>
     <filter>
         <filter-name>sitemesh</filter-name>
         <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
     </filter>
     <filter>
         <filter-name>struts2-execute</filter-name>
         <filter-class>org.apache.struts2.dispatcher.filter.StrutsExecuteFilter</filter-class>
     </filter>

     <filter-mapping>
         <filter-name>struts2-prepare</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
     <filter-mapping>
         <filter-name>sitemesh</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
     <filter-mapping>
         <filter-name>struts2-execute</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.