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 what happens first when request goes to container? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
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: 931
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: 60053
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 931
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: 12678
    
    5
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: 931

Why do you care?

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

Joined: Jan 10, 2002
Posts: 60053
    
  65

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: 931

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 compilation
HFJS - small doubt
j_security_check - How to pass parameters in the URL
When web.xml is loaded?
JSP