This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes Thread based Explanation on sequence of events when multiple requests come at a time 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 "Thread based Explanation on sequence of events when multiple requests come at a time" Watch "Thread based Explanation on sequence of events when multiple requests come at a time" New topic
Author

Thread based Explanation on sequence of events when multiple requests come at a time

RabiDas Sharma
Ranch Hand

Joined: Nov 18, 2013
Posts: 69
Hi everyone,
Please correct me if i'm wrong.

whenevr a request for servlet comes the request is sent from web server(Apache)
to servlet engine and then it checks the deployment descriptor for configuration
information and instantiates a particular servlet accordingly and then it invokes service method
ans as per http request doGet() or doPost() is invoked.


If multiple request comes at a time, a thread is created to serve each request.
Does it instantiate servlet only once for all requests or for each request a servlet is instantiated??

I think servlet is instantiated only once when 1st request comes and then for all further requests
a new thread is started in service method....

please check and rectify the above quote.

please tell me sequence of event dat take place when multiple request comes at a time from thread point of view.

thanks in advance
Chris R Barrett
Ranch Hand

Joined: Dec 05, 2013
Posts: 88
    
    5

Hi RabiDas,

I suggest you read up on the Servlet LifeCycle, as it contains the answers you seek.
For your convenience, the link is: http://docs.oracle.com/javaee/7/tutorial/doc/servlets002.htm

Cheers!
Chris
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread based Explanation on sequence of events when multiple requests come at a time