Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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

Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
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: 42371
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 - my free Android networking tools app
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