• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet and Requests

 
Dilip kumar
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All -

If I understood correctly whenever a new request (from browser) comes to a servlet it will handle that request in a new thread. And there will be only one instance of the servlet. How does a servlet differentiates 2 requests coming from same PC ?

Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does a servlet differentiates 2 requests coming from same PC ?

Each request will be handled in its own Thread. If they are both coming from the same browser, they will (probably) have the same session. It is up to the programmer to handle any logic problems that might arise.
Multiple requests from the same browser are quite common - for example with servlet created images.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic