aspose file tools*
The moose likes Servlets and the fly likes when the init() method will be callled Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "when the init() method will be callled" Watch "when the init() method will be callled" New topic
Author

when the init() method will be callled

chandra kunchala
Greenhorn

Joined: Aug 06, 2008
Posts: 17
HI,
can you tell me when the init() method will be called.


Thanks & Regards
Chandra SCJP5.0
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42632
    
  65
The javadocs of Servlet.init(ServletConfig) and GenericServlet.init() combined together answer this question.

Note that a servlet may placed into service either at startup of the web app, or when the first request for that servlet comes in.


Ping & DNS - my free Android networking tools app
Rohith Kumar Singh
Greenhorn

Joined: Aug 27, 2008
Posts: 6
init() method of a Servlet is called by the Servlet Container at the time of initializing the servlet. There are two types of initialization possible: pre-initialization (which is done using load-on-startup element of web.xml) and lazy initialization (on demand).

Cheers,
Rohit
[ August 27, 2008: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: when the init() method will be callled