File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Is it mandatory (request thread). Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Is it mandatory (request thread)." Watch "Is it mandatory (request thread)." New topic

Is it mandatory (request thread).

Inocencio Oliveira

Joined: Oct 13, 2005
Posts: 23
I read that the container creates for each request captured a thread. I know that one thread is generated to handle one Servlet instance, if you have ten started Servlets and all up, so you got one thread for each Servlet started, but for each request do you have addicional threads running?

<b>Keep your mind flowing away!</b>
Mateus Lucio
Ranch Hand

Joined: Jul 27, 2006
Posts: 60
Yes, assuming that you have 10 diferent servlets in your webapp then the container will create/allocate 1 thread per request, independently of what servlet will serve that request.

Studying ...
vani venkat
Ranch Hand

Joined: Nov 21, 2006
Posts: 142
how can we have many instances of single servlet in one JVM?

SCJP 1.4, SCWCD 1.5
Prasad Kumbhare

Joined: Oct 18, 2007
Posts: 26

To answer your questions, if servlet implements Single Thread Model then vendor can implement STM by creating multiple instances of servlet and make sure that every sevlet instance creates only one thread at a time.


Prasad Kumbhare
SCJP 5.0, SCWCD 5.0, SCBCD 5.0
vani venkat
Ranch Hand

Joined: Nov 21, 2006
Posts: 142
ooh, got it. thanks prasad.
I agree. Here's the link:
subject: Is it mandatory (request thread).
It's not a secret anymore!