org.apache.struts2.dispatcher.listener

## Class StrutsListener

- java.lang.Object
- - org.apache.struts2.dispatcher.listener.StrutsListener

- All Implemented Interfaces:
    EventListener, javax.servlet.ServletContextListener

      public class StrutsListener
      extends Object
      implements javax.servlet.ServletContextListener

  Servlet listener for Struts. The preferred way to use Struts is as a filter via the `StrutsPrepareAndExecuteFilter` and its variants. This might be useful if Struts config information is needed from other servlet listeners, like Sitemesh or OSGi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StrutsListener()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `contextDestroyed(javax.servlet.ServletContextEvent sce)`
    `void` | `contextInitialized(javax.servlet.ServletContextEvent sce)`

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

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

- - ### Constructor Detail

    - #### StrutsListener

          public StrutsListener()

  - ### Method Detail

    - #### contextInitialized

          public void contextInitialized(javax.servlet.ServletContextEvent sce)

      Specified by:
        `contextInitialized` in interface `javax.servlet.ServletContextListener`

    - #### contextDestroyed

          public void contextDestroyed(javax.servlet.ServletContextEvent sce)

      Specified by:
        `contextDestroyed` in interface `javax.servlet.ServletContextListener`

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