This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design forum!
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Doubt in init method
It's not a secret anymore!