Hi guys.. Well can u tell me that why there is need of
"init()" , i mean why can not we initialize the servlet object
with the help of constructors?
Thank you.

Answer Posted / neha rajpal

the very first step of creating the servlet is making its
object after until and unless you will not trigger the init
method it will be treated as simple object not the servlet
after triggering the init method it get the servlet config
init parameters and then only it is called as servlet so its
very imp to intiate the init method

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the procedure of invoking different servlet in a different application?

761


What is dispatcher servlet?

784


What is the difference between a generic servlet and http servlet?

709


Explain how to improve Servlet Performance?

821


What are the common methods that are included in the http servlet class?

782


What do you mean by default initialization in java servlet?

847


What is the use of welcome-file-list?

750


When servlet object is created?

797


What is context in servlet?

746


What do you mean by annotations in servlet?

780


How can a servlet be used to generate plain text instead of html?

736


Explain request dispatcher and its methods.

765


Difference between doget and dopost?

901


What do you mean by filter in servlet?

731


What is the use of httpservletrequestwrapper and httpservletresponsewrapper?

758