Class 2 |
Intermediate Java 30-IT-397 |
|
service()
-
The server creates a new thread that calls service() each time a request
arrives.
-
service() checks the HTTP request type, and calls the appropriate method,
usually either doGet() or doPost().
-
If you want to handle both doGet() and doPost() the same way, just have
one call the other.
doGet(), doPost(), etc.
-
This is where the brains of your servlet exist. Most of the processing
occurs here.
-
There are others available (doPut, doDelete, doOptions, doTrace), but these
are not frequently used.
SingleThreadModel interface

Created by: Brandan Jones
December 20, 2001