Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.portlet.context
Class ServletContextHolderListener

    java.lang.Object
      org.apache.struts2.portlet.context.ServletContextHolderListener

All Implemented Interfaces:
  EventListener, ServletContextListener

    public class ServletContextHolderListener

extends Object
implements ServletContextListener

Some of the factory/managers (e.g. the ObjectFactory) need access to the `ServletActionContext` object when initializing. This `ServletContextListener` keeps a reference to the `ServletContext` and exposes it through a `public static` method.

Field Summary
`private static ServletContext` | `context`

Constructor Summary
`ServletContextHolderListener()`

Method Summary
`void` | `contextDestroyed(ServletContextEvent event)`
`void` | `contextInitialized(ServletContextEvent event)` Stores the reference to the `ServletContext`.
`static ServletContext` | `getServletContext()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### context

    private static ServletContext context

Constructor Detail

### ServletContextHolderListener

    public ServletContextHolderListener()

Method Detail

### getServletContext

    public static ServletContext getServletContext()

  Returns:
    The current servlet context

### contextInitialized

    public void contextInitialized(ServletContextEvent event)

  Stores the reference to the `ServletContext`.

  Specified by:
    `contextInitialized` in interface `ServletContextListener`
  See Also:
    `ServletContextListener.contextInitialized(javax.servlet.ServletContextEvent)`

### contextDestroyed

    public void contextDestroyed(ServletContextEvent event)

  Specified by:
    `contextDestroyed` in interface `ServletContextListener`
  See Also:
    `ServletContextListener.contextDestroyed(javax.servlet.ServletContextEvent)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.