title: How does multithreading work for a java Servlet?
body: <p>Java Servlet life cycle is managed by the servlet container. When first web request comes in, the container will load the Servlet class, calls its init method, then calls its service method to process the web request. It says there can be only one instance of servlet class. The container creates multiple threads and manages these threads to process multiple web requests (this is what I know from my knowledge). But I want to understand, how multiple threads are running and processing multiple simultaneous web requests given that there is only one instance of the servlet class. Can some one shed light on this?</p>