• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what happens first when request goes to container?

 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Why do you care?

no, i am just asking..just a learning exercise..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic