aspose file tools
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


Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt in init method" Watch "Doubt in init method" New topic
Author

Doubt in init method

Abhishek Mantri
Greenhorn

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
Greenhorn

Joined: Sep 06, 2007
Posts: 25
Thanks Joy !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in init method