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 / archana
When u create a servlet with a constructor it wont be a
complete servlet but will be in a akward state where it
cannot access Servlet Context and Config.It has to go
through the init() method (though we dont know what code is
written there) to be a complete servlet
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What's the architecture of a servlet package?
What is the effective way to make sure all the servlets are accessible only when user has a valid session?
How servlets are deployed in java?
How will two or three servlets interact or communicate with each other?
What are the steps that are involved in using the httpservlet class?
Explain the servlet context.
Why is Servlet so popular?
Can we use threads in Servlets?
What is servlet container?
Which httpsession object is used to view and manipulate information about a session?
What is setattribute in servlet?
How do we translate jsp?
What are the two important api's in for servlets?
Explain the features are in servlet 3?
Which exception is thrown if the servlet is not initialized properly?