• 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

Lazy initialization of the servlet

 
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Per my understanding when Servlet Container calls the init method on a servlet instance ...

"The servlet container calls init(ServletConfig) method at most once on a Servlet instance. It is guaranteed to be called before the container delegates a request to the servlet instance. "

In lazy initialization: It is possible that the container may never call the init method. This happens usually when the containers do lazy initialization of the servlet. i.e. they call the init method only upon first request to the servlet.

When lazy initialization of the servlet come to play role? what senerio and how it is done( DD or on code)? Is it covered for Test?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All servlets are lazy loaded, unless the <load-on-startup> tag is specified in the deployment descriptor. In any case, the servlet life cycle is the same, which means that the init method will be invoked by the container.
reply
    Bookmark Topic Watch Topic
  • New Topic