com.opensymphony.webwork.lifecycle
Class RequestLifecycleFilter

java.lang.Object
  extended bycom.opensymphony.webwork.lifecycle.RequestLifecycleFilter
All Implemented Interfaces:
Filter

public class RequestLifecycleFilter
extends Object
implements Filter

A filter to handle the lifecycle of an HTTP request-based XWork component manager.

Author:
Scott N. Smith, Joe Walnes, Bill Lynch (docs)

Constructor Summary
RequestLifecycleFilter()
           
 
Method Summary
protected  com.opensymphony.xwork.interceptor.component.DefaultComponentManager createComponentManager()
          Returns a new DefaultComponentManager instance.
 void destroy()
          Does nothing.
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
          Initializes an XWork component manager for the lifetime of the request.
protected  ServletContext getServletContext(HttpSession session)
          Servlet 2.3 specifies that the servlet context can be retrieved from the session.
 void init(FilterConfig filterConfig)
          Does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestLifecycleFilter

public RequestLifecycleFilter()
Method Detail

destroy

public void destroy()
Does nothing.

Specified by:
destroy in interface Filter

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
Initializes an XWork component manager for the lifetime of the request. Once the manager is initialized, control is passed down the filter chain and when it returns the container is destroyed.

Specified by:
doFilter in interface Filter
Parameters:
request - the ServletRequest object
response - the ServletResponse object
chain - the FilterChain object
Throws:
IOException - if an error occurs while executing the filter
ServletException - if an error occurs while executing the filter

init

public void init(FilterConfig filterConfig)
          throws ServletException
Does nothing.

Specified by:
init in interface Filter
Throws:
ServletException

getServletContext

protected ServletContext getServletContext(HttpSession session)
Servlet 2.3 specifies that the servlet context can be retrieved from the session. Unfortunately, some versions of WebLogic can only retrieve the servlet context from the filter config. Hence, this method enables subclasses to retrieve the servlet context from other sources.

Parameters:
session - the HTTP session where, in Servlet 2.3, the servlet context can be retrieved
Returns:
the servlet context.

createComponentManager

protected com.opensymphony.xwork.interceptor.component.DefaultComponentManager createComponentManager()
Returns a new DefaultComponentManager instance. This method is useful for developers wishing to subclass this class and provide a different implementation of DefaultComponentManager.

Returns:
a new DefaultComponentManager instance.

WebWork Project Page