Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

does init method exexcutes everytime

 
Chandra Bairi
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does init() method exexutes everytime for each and every servlet instance created in a singleThreadModel implemented servlet or only the service method gets executed for separate threads for separate instances.
 
Mikalai Zaikin
Ranch Hand
Posts: 3371
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
The "init" method executed *once* for *every* servlet instance.
It does not matter implements it oe not SingleThreadedModel (STM).
But in case of STM, container might decide to have several instances
of the same servlet to improve performance , and "init" method will be invoked for *every* instance of the same servlet, but only *once*.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic