org.apache.cactus.server
Class FilterConfigWrapper

java.lang.Object
  extended by org.apache.cactus.server.FilterConfigWrapper
All Implemented Interfaces:
javax.servlet.FilterConfig

public class FilterConfigWrapper
extends java.lang.Object
implements javax.servlet.FilterConfig

Wrapper around FilterConfig which overrides the getServletContext() method to return our own wrapper around ServletContext.

Version:
$Id: FilterConfigWrapper.java 239054 2004-10-24 01:30:23Z felipeal $
See Also:
ServletContext

Constructor Summary
FilterConfigWrapper(javax.servlet.FilterConfig theOriginalConfig)
           
 
Method Summary
 java.lang.String getFilterName()
           
 java.lang.String getInitParameter(java.lang.String theName)
           
 java.util.Enumeration getInitParameterNames()
          Return the union of the parameters defined in the Redirector web.xml file and the one set using the setInitParameter() method.
 javax.servlet.ServletContext getServletContext()
           
 void setFilterName(java.lang.String theFilterName)
          Sets the filter name.
 void setInitParameter(java.lang.String theName, java.lang.String theValue)
          Sets a parameter as if it were set in the web.xml file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterConfigWrapper

public FilterConfigWrapper(javax.servlet.FilterConfig theOriginalConfig)
Parameters:
theOriginalConfig - the original filter config object
Method Detail

setInitParameter

public void setInitParameter(java.lang.String theName,
                             java.lang.String theValue)
Sets a parameter as if it were set in the web.xml file.

Parameters:
theName - the parameter's name
theValue - the parameter's value

setFilterName

public void setFilterName(java.lang.String theFilterName)
Sets the filter name. That will be the value returned by the getFilterName() method.

Parameters:
theFilterName - the filter name

getFilterName

public java.lang.String getFilterName()
Specified by:
getFilterName in interface javax.servlet.FilterConfig
Returns:
the simulated filter's name if defined or the redirector filter's name

getServletContext

public javax.servlet.ServletContext getServletContext()
Specified by:
getServletContext in interface javax.servlet.FilterConfig
Returns:
our own wrapped servlet context object

getInitParameterNames

public java.util.Enumeration getInitParameterNames()
Return the union of the parameters defined in the Redirector web.xml file and the one set using the setInitParameter() method. The parameters with the same name (and same case) are only returned once.

Specified by:
getInitParameterNames in interface javax.servlet.FilterConfig
Returns:
the init parameters

getInitParameter

public java.lang.String getInitParameter(java.lang.String theName)
Specified by:
getInitParameter in interface javax.servlet.FilterConfig
Parameters:
theName - the name of the parameter's value to return
Returns:
the value of the parameter, looking for it first in the list of parameters set using the setInitParameter() method and then in those set in web.xml.


Copyright © 2001-2009 The Apache Software Foundation. All Rights Reserved.