aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Lazy initialization of the servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Lazy initialization of the servlet" Watch "Lazy initialization of the servlet" New topic
Author

Lazy initialization of the servlet

Aaron Raja
Ranch Hand

Joined: Jun 07, 2007
Posts: 206
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?

Thanks, AR
SCWCD 5, SCJP 1.4, OCA (PL/SQL)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Lazy initialization of the servlet