img
The HttpSer vlet Class
The HttpServlet class extends GenericServlet. It is commonly used when developing servlets
that receive and process HTTP requests. The methods of the HttpServlet class are summarized
in Table 31-9.
The HttpSessionEvent Class
HttpSessionEvent encapsulates session events. It extends EventObject and is generated when
a change occurs to the session. It defines this constructor:
HttpSessionEvent(HttpSession session)
Here, session is the source of the event.
HttpSessionEvent defines one method, getSession( ), which is shown here:
HttpSession getSession( )
It returns the session in which the event occurred.
Method
Description
void doDelete(HttpSer vletRequest req,
Handles an HTTP DELETE request.
HttpSer vletResponse res)
throws IOException, Ser vletException
void doGet(HttpSer vletRequest req,
Handles an HTTP GET request.
HttpSer vletResponse res)
throws IOException, Ser vletException
void doHead(HttpSer vletRequest req,
Handles an HTTP HEAD request.
HttpSer vletResponse res)
throws IOException,
Ser vletException
void doOptions(HttpSer vletRequest req,
Handles an HTTP OPTIONS request.
HttpSer vletResponse res)
throws IOException, Ser vletException
void doPost(HttpSer vletRequest req,
Handles an HTTP POST request.
HttpSer vletResponse res)
throws IOException, Ser vletException
void doPut(HttpSer vletRequest req,
Handles an HTTP PUT request.
HttpSer vletResponse res)
throws IOException, Ser vletException
void doTrace(HttpSer vletRequest req,
Handles an HTTP TRACE request.
HttpSer vletResponse res)
throws IOException, Ser vletException
long
Returns the time (in milliseconds since midnight, Januar y 1,
getLastModified(HttpSer vletRequest req) 1970, GMT) when the requested resource was last modified.
void ser vice(HttpSer vletRequest req,
Called by the ser ver when an HTTP request arrives for this
HttpSer vletResponse res)
servlet. The arguments provide access to the HTTP request and
throws IOException, Ser vletException
response, respectively.
TABLE 31-9
The Methods Defined by HttpServlet
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home