public abstract class AbstractHttpServlet
extends javax.servlet.http.HttpServlet
Constructor and Description |
---|
AbstractHttpServlet() |
Modifier and Type | Method and Description |
---|---|
static void |
clearSessionData(javax.servlet.http.HttpSession session)
Clears all data from the supplied session.
|
void |
destroy()
Called by the servlet runner when this servlet has to be destroyed.
|
protected int |
getActiveRequests()
Gets the number of active requests.
|
protected Locale |
getLocale(javax.servlet.http.HttpServletRequest request)
Gets the locale.
|
protected String |
getRequiredInitParameter(String parameterName)
Gets a required initialization parameter.
|
String |
getServletInfo()
Returns information about the servlet.
|
static String |
getSessionInfo(javax.servlet.http.HttpServletRequest request)
Gets the session information from the supplied request and converts it to a single string.
|
void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
A wrapper around the service method to do some housekeeping chores like time measurement and keeping track of active
requests.
It is guaranteed by the Servlet specifications that this method will not be called when the Servlet container is in the process of shutting down. |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
protected int getActiveRequests()
public void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
service
in class javax.servlet.http.HttpServlet
request
- The HttpServletRequest.response
- The HttpServletResponse.IOException
- When an error occurs while writing to the PrintStream of the supplied response object.javax.servlet.ServletException
- When a subclass throws this exception.protected Locale getLocale(javax.servlet.http.HttpServletRequest request)
request
- The request.public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
public String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
protected String getRequiredInitParameter(String parameterName) throws javax.servlet.UnavailableException
GenericServlet.getInitParameter(String)
for optional init parameters.
parameterName
- Name of the required init parameter.javax.servlet.UnavailableException
- When the init parameter is missing or when the parameter value is null.public static String getSessionInfo(javax.servlet.http.HttpServletRequest request)
request
- The request.NullPointerException
- When the supplied request is null.public static void clearSessionData(javax.servlet.http.HttpSession session)
session
- HttpSession to clear.NullPointerException
- When the supplied session is null.Copyright © 2008–2018. All rights reserved.