There is a convenience method init() in GenericServlet (note it takes no parameters) that you should override if you want to provide 'subclass specific features', and not override the init(SevletConfig) method.
In my version of Tomcat 5.0.28 (I Think) this is all that the init(ServletConfig) method does. This may not be the same on all versions of Tomcat or on all web containers.
Joined: Nov 15, 2004
I think u didn't understand my question.
I know there is a convenience init() method thats takes no argument which we are supposed to override.
But I want to know why we should call super.init(ServletConfig) if we override the init() method that take a ServletConfig instance.
Joined: Jul 20, 2005
1) Different containers may be doing different things in the init(ServletConfig) method. Therefore if you are possibly going to change the container that your application runs on, to ensure that the container does everything it needs to do, you should call super.init(ServletConfig).
3) It is generally bad practice, init() is provided for this very reason. Therefore others maintaing your code will probably not be thinking that they can't call getServletConfig(), or that something else may be broken because you overrode init(ServletConfig) rather than init().