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 Threads & Instances Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Threads & Instances" Watch "Threads & Instances" New topic
Author

Threads & Instances

varun bihani
Ranch Hand

Joined: Aug 11, 2003
Posts: 96
I have a very general question as i am a neophyte in java.
I want to know what is difference between instances and threads in servlets/jsp.
I want to know how does servlet handled multiple requests(simultaneous).


<a href="http://www.galaxyweblinks.com" target="_blank" rel="nofollow">www.galaxyweblinks.com</a><br /><a href="http://www.freechatcode.com" target="_blank" rel="nofollow">www.freechatcode.com</a><br /><a href="http://www.onlinefamilytreemaker.com" target="_blank" rel="nofollow">www.onlinefamilytreemaker.com</a>
Idly Vada
Ranch Hand

Joined: Sep 02, 2003
Posts: 135
I think you should read about processes and threads.
Sun tutorial at
http://java.sun.com/docs/books/tutorial/essential/threads/
may help you.

If you use SingleThreadModel for a servlet, an instance of servlet is created for each request.
Ohterwise, a new thread is created for each request.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Threads & Instances