1. Creates an Instance of the servlet class (Constructor)
2. Initializes the servlet (init method) and wait for requests.
3. if any request comes in, service method is called and this determines which type of request it is and calls the appropriate method(like doGet, doPost etc...)
4. The destroy method is called before removing the servlet from the container
I think you can trace what is happening by putting as the first line of the method definition and at the end of the method definition.
SCJP 1.5, SCWCD 1.4.
Hanging between Web Services and EJB
Joined: Mar 22, 2005
If this code is just for experiment then its fine, otherwise in general refrain from overriding the service method. Override the doPost and/or doGet methods instead...
+1. The service method doesn't need to be overwritten unless you're writing a servlet to handle HTTP extensions (which would be an exceedingly rare occasion).