aspose file tools
The moose likes Servlets and the fly likes what happens first when request goes to container? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "what happens first when request goes to container?" Watch "what happens first when request goes to container?" New topic
Author

what happens first when request goes to container?

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 902
i have a question related to servlet.
when we made a request for a page using HttpServletRequest, the container(tomcat), first allocate thread for that request or first it will check weather the requested page is exist in the project or not??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56179
    
  13

What did the Servlet Spec have to say about this? Hint: if it doesn't say anything, then what happens is completely up to the container implementation.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 902
so you mean it depends on the container.
weather to check for request first or allocate thread for that request..
but if it allocate thread first and if the requested url/page is not found, than it's wastage???
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12267
    
    1
I think it is safe to say that it is the Thread allocated to the request which does the actual lookup since it needs the servlet context for the particular web application.

Furthermore, it is only good practice to have the socket handler Thread hand off to a separate thread as soon as possible.

Why do you care?


Java Resources at www.wbrogden.com
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 902

Why do you care?

no, i am just asking..just a learning exercise..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56179
    
  13

Many of the details of what the containers do internally, especially details such as this, don't have much bearing on how to write good web applications.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 902

Many of the details of what the containers do internally, especially details such as this, don't have much bearing on how to write good web applications.


okay....thank you....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what happens first when request goes to container?
 
Similar Threads
JSP
When web.xml is loaded?
jsp compilation
HFJS - small doubt
j_security_check - How to pass parameters in the URL