Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How container manage to serve servlet to number of request  RSS feed

 
Prabhat Shankar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,



how my servlet is maintained in container for multi thread environment.

OR

How container manage to serve servlet to number of request.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what you're asking. Each request is handled by a separate thread.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AND -

Each Thread has its own request and response object references - not shared with any other request. Servlet programmers just have to manage any additional objects which may be created so that they are not visible to other requests.

Yes, this is kind of hard to get your head around when you have been doing only single user/single thread applications.

Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WHICH - is why it's important to write your servlets in a thread-safe manner.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!