Java Reference
In-Depth Information
The
doGet()
Method
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException
java.io.IOException
The
doGet()
method services all
GET
requests for the servlet.
N
OTE
The
HttpServlet
class's
doGet
,
doPost
,
doPut
,
doDelete
,
doOptions
, and
doTrace
methods all receive the same two parameters—an
HttpServletRequest
object, which
encapsulates the client's request, and an
HttpServletResponse
object, which contains
the response that is sent back to the client. Each of these methods throws a
ServletException
if it cannot service the request and throws a
java.io.IOException
if there was an I/O error. These methods return no value.
The
doPost()
Method
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException
java.io.IOException
The
doPost()
method services all
POST
requests for the servlet.
The
doPut()
Method
protected void doPut(HttpServletRequest request,
HttpServletResponse response)
throws ServletException
java.io.IOException
The
doPut()
method services all
PUT
requests for the servlet.
The
doDelete()
Method
protected void doDelete(HttpServletRequest request,
HttpServletResponse response)
throws ServletException
java.io.Exception
The
doDelete()
method services all
DELETE
requests for the servlet.