top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Why do we need to call super.init(config) in the init method of a servlet?

+1 vote
108 views
Why do we need to call super.init(config) in the init method of a servlet?
posted Nov 24, 2015 by Joy Nelson

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Because if you don’t, then the config object will get lost. Just extend HttpServlet, use init() (no parameters) and it’ll all work ok.
From the Javadoc: init() – A convenience method which can be overridden so that there’s no need to call super.init(config).

answer Nov 25, 2015 by Karthick.c
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...