public class ServletWrapper extends Object implements ServletConfig
Servlet.init(ServletConfig)
,
Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
and Servlet.destroy()
.Modifier and Type | Field and Description |
---|---|
private ServletContext |
context |
private String |
name |
private Map<String,String> |
parameters |
private Class<? extends Servlet> |
servletClass |
Constructor and Description |
---|
ServletWrapper(Class<? extends Servlet> servletClass,
String name) |
Modifier and Type | Method and Description |
---|---|
String |
getInitParameter(String name) |
Enumeration<String> |
getInitParameterNames() |
ServletContext |
getServletContext() |
String |
getServletName() |
void |
service(HttpServletRequest request,
HttpServletResponse response)
Service a request to the wrapped servlet.
|
(package private) void |
setParameter(String name,
String value)
Set the value of a servlet parameter.
|
(package private) void |
setServletContext(ServletContext context)
Set the servlet context from the web application.
|
private final String name
private ServletContext context
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
request
- The request parametersresponse
- The response objectServletException
IOException
void setParameter(String name, String value)
name
- The name of the parametervalue
- The value of the parametervoid setServletContext(ServletContext context)
public String getInitParameter(String name)
getInitParameter
in interface ServletConfig
public Enumeration<String> getInitParameterNames()
getInitParameterNames
in interface ServletConfig
public ServletContext getServletContext()
getServletContext
in interface ServletConfig
public String getServletName()
getServletName
in interface ServletConfig