File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How servlet container maintain threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How servlet container maintain threads" Watch "How servlet container maintain threads" New topic

How servlet container maintain threads

Gaurav Agarwal

Joined: Oct 13, 2004
Posts: 18
How servlet container maintain more than one request through threads? How many object of servlet are created?

Thanks in advance

Gaurav Agarwal
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 39551
Each servlet is only instantiated once. But the container allocates a new thread for each incoming request, and inside the thread calls the servlet's service method.

Ping & DNS - updated with new look and Ping home screen widget
Gaurav Agarwal

Joined: Oct 13, 2004
Posts: 18

Thanks for your response,

Request you to kindly elaborate the hole process once again so i can understand it more clearly.

Gaurav Agarwal
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

That's a tall order.
Maybe too tall for a web forum.

In my signature, there is a link to the servlet specification.
It's an easy read and should answer all of your questions.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: How servlet container maintain threads
Similar Threads
Advise - Servlet + Understanding Thread and Instance
Servlet instantiation
servlet container and multi threading
servlet to another client
How servlet process multiple request.