org.apache.cactus.server
Class ServletConfigWrapper
java.lang.Object
|
+--org.apache.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:
- $Id: ServletConfigWrapper.java,v 1.5 2001/09/14 20:14:05 pier Exp $
- Author:
- Vincent Massol
- See Also:
ServletContext
Method Summary |
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()
|
java.lang.String |
getServletName()
|
void |
setInitParameter(java.lang.String theName,
java.lang.String theValue)
Sets a parameter as if it were set in the web.xml file. |
void |
setServletName(java.lang.String theServletName)
Sets the servlet name. |
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
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
getServletContext
public javax.servlet.ServletContext getServletContext()
- Specified by:
getServletContext
in interface javax.servlet.ServletConfig
- 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.ServletConfig
- Returns:
- the init parameters
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
.
Copyright © 2000-2001 Apache Software Foundation. All Rights Reserved.