Class ServletWrapper
java.lang.Object
net.sf.basedb.clients.web.extensions.ServletWrapper
- All Implemented Interfaces:
ServletConfig
A wrapper class for servlets defined by extensions. This wrapper holds
initialisation parameters and the servlet context that a servlet
needs. Each request to a servlet will create a new instance of the
servlet, followed by calls to
Servlet.init(ServletConfig)
,
Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
and Servlet.destroy()
.- Version:
- 2.7
- Author:
- nicklas
- Last modified
- $Date: 2018-11-07 09:07:03 +0100 (on, 07 nov 2018) $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetInitParameter
(String name) 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.
-
Field Details
-
servletClass
-
name
-
context
-
parameters
-
-
Constructor Details
-
ServletWrapper
-
-
Method Details
-
service
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException Service a request to the wrapped servlet. A new servlet instance is created for each request.- Parameters:
request
- The request parametersresponse
- The response object- Throws:
ServletException
IOException
-
setParameter
Set the value of a servlet parameter.- Parameters:
name
- The name of the parametervalue
- The value of the parameter
-
setServletContext
Set the servlet context from the web application. -
getInitParameter
- Specified by:
getInitParameter
in interfaceServletConfig
-
getInitParameterNames
- Specified by:
getInitParameterNames
in interfaceServletConfig
-
getServletContext
- Specified by:
getServletContext
in interfaceServletConfig
-
getServletName
- Specified by:
getServletName
in interfaceServletConfig
-