File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
 
Similar Threads
what if we override the init(ServletConfig) and dont call super()
init methods of Servlets: need clarification
getInitParamater() method
Why does GenericServlet implements ServletConfig?
passing ServletContext