org.apache.struts2.portlet.context
Class ServletContextHolderListener
java.lang.Object
org.apache.struts2.portlet.context.ServletContextHolderListener
- All Implemented Interfaces:
- java.util.EventListener, javax.servlet.ServletContextListener
public class ServletContextHolderListener
- extends java.lang.Object
- implements javax.servlet.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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServletContextHolderListener
public ServletContextHolderListener()
getServletContext
public static javax.servlet.ServletContext getServletContext()
- Returns:
- The current servlet context
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent event)
- Stores the reference to the
ServletContext
.
- Specified by:
contextInitialized
in interface javax.servlet.ServletContextListener
- See Also:
ServletContextListener.contextInitialized(javax.servlet.ServletContextEvent)
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent event)
- Specified by:
contextDestroyed
in interface javax.servlet.ServletContextListener
- See Also:
ServletContextListener.contextDestroyed(javax.servlet.ServletContextEvent)
Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.