• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt on servlet request  RSS feed

 
Ram Korutla
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very basic doubt.In a web application, suppose that we have clicked on a hyperlink and it maked a request to a servlet for some process and before the action completes we click on a different hyperlink triggering a different request. Now the earlier request has died out and the latest request is being handled.Who takes care of killing the first request?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the first request got transmitted sucessfully, the receiving servlet will have a Thread working on it. Anything that happens on the client browser to ignore the response will not get noticed by the servlet until the first attempt to actually write the response. At that point it will see that the connection no longer exists and throw an exception. As I recall, you will see a "ConnectionClosedByPeer" or something similar as an error in log files.

Obviously this could waste a lot of CPU resources if the process does no output until the end of lots of processing.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!