This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Multiple Servlet Request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Multiple Servlet Request" Watch "Multiple Servlet Request" New topic
Author

Multiple Servlet Request

Savio Mascarenhas
Ranch Hand

Joined: Nov 29, 2000
Posts: 108
Hi Guys !!!
How is Servlet Requests by multiple users actually handled ?
I've heard of multi-threading taking place. Does this happen on the part of the web server or does the Servlet Container create a separate thread for each request where the run()contains a call to that servlets service(). How does it actually happen ???
Thanks Guys !!!
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12756
    
    5
You need to get hold of a basic book or tutorial on servlets. Working in the servlet environment is quite different from a single user application.
It is the responsibility of the servlet container to create / assign a Thread to each request. Usually the servlet container keeps a pool of Threads to avoid the extra computation of creating a new one. All of the context for a particular request and response is handled by that Thread.
In addition, a servlet container will have a number of other Threads minding various chores such a keeping track of sessions.
Bill
Savio Mascarenhas
Ranch Hand

Joined: Nov 29, 2000
Posts: 108
Thanks Bill !!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Multiple Servlet Request
 
Similar Threads
java.lang.OutOfMemoryError: Java heap space
Request getting hanged..
Multiple Frames Updated by One Servlet?
Servlet handling multiple requests?
Multiple threads for each Client Request