File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Why Init() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

Why Init() method

Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
I have a basic question. Why there is a Init method in servlets. Can't we have a constructor do what Init method does ?
Shantanu Puranik
Ranch Hand

Joined: Jun 10, 2004
Posts: 67
Chetan,

This question is already answered HERE.


--- Shantanu
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
servletConfig and servletContext are not available in constructor..


Rahul Bhattacharjee
LinkedIn - Blog
 
Don't get me started about those stupid light bulbs.
 
subject: Why Init() method
 
Similar Threads
How does servlet decide which init method to call
init() method doubt?
init() vs constructor
init missing in servlet
difference b/w init() and init( config)