This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 41164
    
  45
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
 
Similar Threads
Mechanism of init method to initialize servlet
Why is init() needed?
suggestions for a "user selectable database" design
How to find if the servlet is newly created or it was already existing
exception handling