a.When we override init(ServletConfig config) method in our servlet then is it mandatory to call super.init(config) from within it ?
No it is not mandatory but the servlet initialization (which includes creating or loading objects that are used by the servlet in the handling of its requests, ability to log events, use its ServletContext refrence etc) is done in the Servlet's init method.
So if super.init() is not called the the class will not get its servletness.
b. If it is mandatory then why my sample servlet ran fine (without giving any error) ?
Your code ran fine because you just flushed some html code to the Response' PrintWriter.
Say for eg if you tried making use of the servlet parameters using Servlet Config object then the code would have thrown a exception.
Say in the doPost method you want to use the servlet paarmeter "NAME"
web.xml
This would have resulted in a exception as config object wasn't initialized since super.init() was not called.So getServletConfig() returned null and calling config.getAttribute("NAME") will result in NullPointerException.
c. What are the implications of
i. calling super.init(config) from within init(ServletConfig config) method in our servlet
ii. not calling super.init(config) from within init(ServletConfig config) method in our servlet
To make use use of the actual servletness of a servlet, it is required to call the super.init() in the overridden method.