The handling of concurrent requests to a Web application generally requires that the Web Developer design servlets that can deal with multiple threads executing within the service method at a particular time. Generally
the Web container handles concurrent requests to the same servlet by concurrent execution of the service method on different threads.
HTTP Specific Request Handling Methods
The HttpServlet abstract subclass adds additional methods beyond the basic Servlet interface that are automatically called by the service method in the HttpServlet class to aid in processing HTTP-based requests.
These methods are:
- doGet for handling HTTP GET requests. This Requests a page from the server. This is the normal request used when browsing web pages.
- doPost for handling HTTP POST requests. This request is used to pass information to the server. Its most common use is with HTML forms.
- doPut for handling HTTP PUT requests. Used to put a new web page on a server.
- doDelete for handling HTTP DELETE requests. Used to delete a web page from the server.
- doHead for handling HTTP HEAD requests.
- doOptions for handling HTTP OPTIONS requests. Intended for use with the web server, listing the supported options.
- doTrace for handling HTTP TRACE requests. Used to trace servers
Typically when developing HTTP-based servlets, a Servlet Developer will only concern himself with the doGet and doPost methods. The other methods are considered to be methods for use by programmers very familiar with HTTP programming.