posted 13 years ago
The Process goes like this:
1. When user initiates a request, the servlet container tries to map the request with servlet that are declared in the Deployment descriptor.
2. Once the container identifies the required servlet, it will create an instance of that servlet.
3. Once the instance is ready, the container allocates a thread for the request and calls the service() method of the servlet, passing the request and response objects as arguements..
4. The service() methods takes care of invocation of http method. (i.e, GET, POST etc..)
5. After completing the service the container removes the thread or moves it to the container-manged thread pool.
Here you have to observe that, each request will run in separate thread and only one instance of servlet will be created per JVM.
- Krishna<br /> SCJP 1.4 SCWCD 5