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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why Init() method