File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes init() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "init() method" Watch "init() method" New topic

init() method

Rajib Sarma
Ranch Hand

Joined: Apr 29, 2002
Posts: 34
We know that the init() method is invoked at the very beginning of it's life cycle. I want to ask, who provide the init() method for a servlet, if we donot write it in our code?
Thanks in advance.

*** Rajib Prasad Sarma ***<br />==========================
chanoch wiggers
Ranch Hand

Joined: May 24, 2001
Posts: 245
An empty implementation is provided by javax.servlet.GenericServlet so that you dont have to implement it if you dont need to.

chanoch<p><a href="" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
I agree. Here's the link:
subject: init() method
It's not a secret anymore!