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

Doubt in init method

Abhishek Mantri

Joined: Sep 06, 2007
Posts: 25
If we override init method which takes (ServletConfig) as argument then why should we call super.init(ServletConfig)??
Joy Mookerji
Ranch Hand

Joined: Jul 26, 2006
Posts: 49
Because the init(ServletConfig) from the GeneriServlet class gives the Servlet the the ServletConfig object (one per servlet) which can be used later on by the Servlet to get access to its say init-params.
This is done by the container so if you want to override the method you should call the super.init(ServletConfig).

SCJP 5<br />Brainbench Certified in C++<br />PMP<br />Dallas,TX
Abhishek Mantri

Joined: Sep 06, 2007
Posts: 25
Thanks Joy !
I agree. Here's the link:
subject: Doubt in init method
It's not a secret anymore!