• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

statement about init() method

 
Ranch Hand
Posts: 95
Spring Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
init() is called only once per instance. And it is called when the servlet container loads the servlet. In cases of high load, it may also instantiate multiple instances of a servlet. In this case, init() will be called on each of the instances.
I think according to the API if servlet does not implement SingleThreadModel then only one instance is created and mutiple threads share this instance.
 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
The init(ServletConfig) method will only be called once. The only two exceptions are if you have declared that this class will implement the SingleThreadModel interface or if more than one <servlet> element is defined in the web.xml file having the same servlet class names.
Regards
[ October 19, 2002: Message edited by: Dominic Steng�rd ]
 
Iftikhar Arain
Ranch Hand
Posts: 95
Spring Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Dominic .
 
reply
    Bookmark Topic Watch Topic
  • New Topic