org.apache.beehive.controls.runtime.servlet
Class ControlFilter
Object
ControlFilter
- All Implemented Interfaces:
- Filter
public class ControlFilter
- extends Object
- implements Filter
The ControlFilter class provides an implementation of an HTTP servlet filter that supports
running controls in the web tier. It works, in conjunction with the ServletBeanContext
class to provide runtime containment for controls. It ensures that a valid BeanContext has
been set up prior to forwarding the request to the actual target servlet, and does
post-processing to ensure that resources have been properly released.
This filter needs to be configured in web.xml for URL mappings that will be hosting servlets.
Field Summary |
static String |
BEAN_CONTEXT_ATTRIBUTE
|
static String |
INIT_PARAM_CONTEXT_CLASS
The contextClass init parameter is a class name that defines the BeanContext class to use
for containing Controls in the servlet container. |
static String |
INIT_PARAM_USE_SESSION
The useSession init parameter is a boolean value that indicates whether the bean context
should be stored in session. |
Method Summary |
void |
destroy()
|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
|
void |
init(FilterConfig filterConfig)
|
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BEAN_CONTEXT_ATTRIBUTE
public static String BEAN_CONTEXT_ATTRIBUTE
INIT_PARAM_USE_SESSION
public static String INIT_PARAM_USE_SESSION
- The useSession init parameter is a boolean value that indicates whether the bean context
should be stored in session. This makes the context (and any contained controls)
accessible across multiple http requests.
INIT_PARAM_CONTEXT_CLASS
public static String INIT_PARAM_CONTEXT_CLASS
- The contextClass init parameter is a class name that defines the BeanContext class to use
for containing Controls in the servlet container. This class must be a subclass of
the org.apache.beehive.runtime.servlet.ServletBeanContext class.
ControlFilter
public ControlFilter()
init
public void init(FilterConfig filterConfig)
throws ServletException
- Specified by:
init
in interface Filter
- Throws:
ServletException
doFilter
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws IOException,
ServletException
- Specified by:
doFilter
in interface Filter
- Throws:
IOException
ServletException
destroy
public void destroy()
- Specified by:
destroy
in interface Filter