org.apache.struts2.dispatcher

## Class FreemarkerCacheDestroyable

- java.lang.Object
- - org.apache.struts2.dispatcher.FreemarkerCacheDestroyable

- All Implemented Interfaces:
    ContextAwareDestroyable, InternalDestroyable

      public class FreemarkerCacheDestroyable
      extends Object
      implements ContextAwareDestroyable

  WW-5537: Clears FreeMarker's template and class introspection caches stored in `ServletContext` during application undeploy, preventing classloader leaks.
  Since:
    6.9.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FreemarkerCacheDestroyable()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy(javax.servlet.ServletContext servletContext)` Releases state that requires access to the `ServletContext`.

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

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

    - ### Methods inherited from interface org.apache.struts2.dispatcher.ContextAwareDestroyable

      `destroy`

- - ### Constructor Detail

    - #### FreemarkerCacheDestroyable

          public FreemarkerCacheDestroyable()

  - ### Method Detail

    - #### destroy

          public void destroy(javax.servlet.ServletContext servletContext)

      Description copied from interface: `ContextAwareDestroyable`
      Releases state that requires access to the `ServletContext`.
      Specified by:
        `destroy` in interface `ContextAwareDestroyable`
      Parameters:
        `servletContext` - the current servlet context, may be `null` if the Dispatcher was created without one

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