The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes what if we override the init(ServletConfig) and dont call super() Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "what if we override the init(ServletConfig) and dont call super()" Watch "what if we override the init(ServletConfig) and dont call super()" New topic
Author

what if we override the init(ServletConfig) and dont call super()

yogendra singh
Greenhorn

Joined: Jan 08, 2004
Posts: 21
what if we override the init(ServletConfig) and dont call super(). will it create the instance of servlet.what the mean fo passing servletConfig object to the servlet other than initialze parameter and giving referenve of server environment.
Vadiraj Deshpande
Ranch Hand

Joined: Aug 16, 2000
Posts: 78
Hi,
If we override init(ServletConfig) method and don't call super(servletConfig) then the servletConfig reference is not stored in the GenericServlet and if we call getServletConfig() we get null.
If we want to override the init method, we can use other init() of GenericServlet method which has no parameters.
Regards,
-Vadiraj
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: what if we override the init(ServletConfig) and dont call super()
 
Similar Threads
init methods of Servlets: need clarification
Doubt in init method
Mock Exam Question
Clarification abt init()
init() method