1. User clicks a link that has a URL of Servlet.web
2. Container (Apache Tomcat is one of the example) sees that the request is for servlet , so create two objects :
HttpServletRequest
HttpServletResponsexml
HttpServletRequest and HttpServletResponseblog
3. Container finds correct servlet on the basis of URL passed with the helpdeployment descriptor (web.xml) file. Creates / Allocate thread for that request and pass request and response object to servle thread.ip
4. Container calls the servlets service() method, on the type of request, service calls doGet() or doPost() methods.servlet
5. Lets assume that service calls the doPost() method. doPost() methodgenerates dynamic page and add the page in response object.class
Servlet - doPost - response objectthread
6. Thread completes, container converts the response object into HttpResponse object and destroys the response and request object.