This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The service(HttpServletRequest, HttpServletResponse) is the HTTP-specific version of the Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) method. Thus, when you make an HTTP request to your server, you get the HTTP service method invoked before the generic service method.
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