File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How Servlet Requests are handled by Webserver internallly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How Servlet Requests are handled by Webserver internallly" Watch "How Servlet Requests are handled by Webserver internallly" New topic
Author

How Servlet Requests are handled by Webserver internallly

satishbsk kumar
Greenhorn

Joined: Jul 24, 2009
Posts: 15
Hi All,
Please clarify whether Server creates new thread(Servlet Instance) for each request.

Rgds,
Satish
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Unless you implement the SingleThreadModel, the container creates a new Thread for each incoming request. Note however that it does not create a new servlet instance, it works on the same unless you have different mappings for one servlet.
So watch out for thread safety.

BTW.. SingleThreadModel is deprecated and should not be used.


JDBCSupport - An easy to use, light-weight JDBC framework -
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Also, in the interests of completeness, a "new thread" and "new servlet instance" are not the same thing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How Servlet Requests are handled by Webserver internallly