wood burning stoves
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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic

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

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
jQuery in Action, 3rd edition