java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
- All Implemented Interfaces:
java.io.Serializable
,Servlet
,ServletConfig
- Direct Known Subclasses:
DefaultServlet
,ServerServlet
public abstract class HttpServlet extends GenericServlet
The HttpServlet API.
- Author:
- Manfred Riem ([email protected])
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description HttpServlet()
Constructor. -
Method Summary
Modifier and Type Method Description protected void
doDelete(HttpServletRequest request, HttpServletResponse response)
Handle a DELETE request.protected void
doGet(HttpServletRequest request, HttpServletResponse response)
Handle a GET request.protected void
doHead(HttpServletRequest request, HttpServletResponse response)
Handle a HEAD request.protected void
doOptions(HttpServletRequest request, HttpServletResponse response)
Handle an OPTIONS request.protected void
doPost(HttpServletRequest request, HttpServletResponse response)
Handle a POST request.protected void
doPut(HttpServletRequest request, HttpServletResponse response)
Handle a PUT request.protected void
doTrace(HttpServletRequest request, HttpServletResponse response)
Handle a TRACE request.protected long
getLastModified(HttpServletRequest request)
Get the last modified header.protected void
service(HttpServletRequest request, HttpServletResponse response)
Process the HTTP request.void
service(ServletRequest request, ServletResponse response)
Process the request.Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
HttpServlet
public HttpServlet()Constructor.
-
-
Method Details
-
getLastModified
Get the last modified header.- Parameters:
request
- the request.- Returns:
- the last modified, or -1 if not known.
-
doDelete
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOExceptionHandle a DELETE request.- Parameters:
request
- the request.response
- the response.- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
doGet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletExceptionHandle a GET request.- Parameters:
request
- the request.response
- the response.- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
doHead
protected void doHead(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOExceptionHandle a HEAD request.- Parameters:
request
- the request.response
- the response.- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
doPost
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOExceptionHandle a POST request.- Parameters:
request
- the request.response
- the response.- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
doPut
protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOExceptionHandle a PUT request.- Parameters:
request
- the request.response
- the response.- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
doOptions
protected void doOptions(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOExceptionHandle an OPTIONS request.- Parameters:
request
- the request.response
- the response.- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
doTrace
protected void doTrace(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOExceptionHandle a TRACE request.- Parameters:
request
- the request.response
- the response.- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
service
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOExceptionProcess the HTTP request.- Parameters:
request
- the request.response
- the response.- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-
service
public void service(ServletRequest request, ServletResponse response) throws java.io.IOException, ServletExceptionProcess the request.- Specified by:
service
in interfaceServlet
- Specified by:
service
in classGenericServlet
- Parameters:
request
- the request.response
- the response.- Throws:
java.io.IOException
- when an I/O error occurs.ServletException
- when a Servlet error occurs.
-