File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lazy initialization of the servlet

 
Aaron Raja
Ranch Hand
Posts: 206
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic