java.lang.Object
jakarta.servlet.GenericServlet
- All Implemented Interfaces:
Servlet
,ServletConfig
,Serializable
- Direct Known Subclasses:
HttpServlet
The GenericServlet API.
- Author:
- Manfred Riem ([email protected])
- See Also:
- Serialized Form
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroy the servlet.getInitParameter(String name)
Get the init parameter.Returns the init parameter names.Returns the servlet config.Returns the servlet context.Get the servlet info.Returns the servlet name.void
init()
Init the servlet.void
init(ServletConfig config)
Called by the servlet container to indicate to a servlet that the servlet is being placed into service.void
Log the message.void
Log the message.abstract void
service(ServletRequest request, ServletResponse response)
Process the request.
-
Constructor Details
-
GenericServlet
public GenericServlet()Constructor.
-
-
Method Details
-
destroy
public void destroy()Destroy the servlet. -
getInitParameter
Get the init parameter.- Specified by:
getInitParameter
in interfaceServletConfig
- Parameters:
name
- the name.- Returns:
- the value, or null.
-
getInitParameterNames
Returns the init parameter names.- Specified by:
getInitParameterNames
in interfaceServletConfig
- Returns:
- the init parameter names
-
getServletConfig
Returns the servlet config.- Specified by:
getServletConfig
in interfaceServlet
- Returns:
- the servlet config
-
getServletContext
Returns the servlet context.- Specified by:
getServletContext
in interfaceServletConfig
- Returns:
- the servlet context
-
getServletInfo
Get the servlet info.- Specified by:
getServletInfo
in interfaceServlet
- Returns:
- ""
-
getServletName
Returns the servlet name.- Specified by:
getServletName
in interfaceServletConfig
- Returns:
- the servlet name
-
init
Called by the servlet container to indicate to a servlet that the servlet is being placed into service. SeeServlet.init(jakarta.servlet.ServletConfig)
.This implementation stores the
ServletConfig
object it receives from the servlet container for later use. When overriding this form of the method, callsuper.init(config)
.- Specified by:
init
in interfaceServlet
- Parameters:
config
- theServletConfig
object that contains configuration information for this servlet- Throws:
ServletException
- if an exception occurs that interrupts the servlet's normal operation- See Also:
UnavailableException
-
init
Init the servlet.- Throws:
ServletException
- when a servlet error occurs.
-
log
Log the message.- Parameters:
message
- the message.
-
log
Log the message.- Parameters:
message
- the message.throwable
- the throwable.
-
service
public abstract void service(ServletRequest request, ServletResponse response) throws ServletException, IOExceptionProcess the request.- Specified by:
service
in interfaceServlet
- Parameters:
request
- the request.response
- the response.- Throws:
IOException
- when an I/O error occurs.ServletException
- when a servlet error occurs.
-