This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Kathy and Bryan mention in their book HFS&J that the service() method in servlets is called by the container.How is it done?I believed that the container just created a thread and "started" it and then it was the run() method of the thread that had a call to service() which in turn would call doXXX().
I believe you're dead on, Mayank. However, I believe some containers will utilize a thread pool, rather than always creating a new thread. So, it may be possible that the container will reuse a thread, rather than making a new one for each request. Regardless, the thread assigned to the request is responsible for invoking the service() method of the HttpServlet.