org.apache.commons.cactus.server
Class ServletConfigWrapper
java.lang.Object
|
+--org.apache.commons.cactus.server.ServletConfigWrapper
- All Implemented Interfaces:
- javax.servlet.ServletConfig
- public class ServletConfigWrapper
- extends java.lang.Object
- implements javax.servlet.ServletConfig
Wrapper around ServletConfig
which overrides the
getServletContext()
method to return our own wrapper around
ServletContext
.
- Version:
- 1.1
- See Also:
ServletContext
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServletConfigWrapper
public ServletConfigWrapper(javax.servlet.ServletConfig theOriginalConfig)
- Parameters:
theOriginalConfig
- the original servlet config object
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 nametheValue
- the parameter's value
setServletName
public void setServletName(java.lang.String theServletName)
- Sets the servlet name. That will be the value returned by the
getServletName()
method.
- Parameters:
theServletName
- the servlet's name
getServletContext
public javax.servlet.ServletContext getServletContext()
- Specified by:
getServletContext
in interface javax.servlet.ServletConfig
- Returns:
- our own wrapped servlet context object
getInitParameter
public java.lang.String getInitParameter(java.lang.String theName)
- Specified by:
getInitParameter
in interface javax.servlet.ServletConfig
- 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
.
getInitParameterNames
public java.util.Enumeration getInitParameterNames()
- Specified by:
getInitParameterNames
in interface javax.servlet.ServletConfig
- Returns:
- the union of the parameters defined in the Redirector
web.xml
file and the one set using the
setInitParameter()
method.
getServletName
public java.lang.String getServletName()
- Specified by:
getServletName
in interface javax.servlet.ServletConfig
- Returns:
- the simulated servlet's name if defined or the redirector
servlet's name
Copyright © 2000-2001 Apache Software Foundation. All Rights Reserved.