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 / abhijit mishra
As per Servlet specification, the servlet container is
responsible for creating the servlet and initializing it( or
making it ready for client to request it).
So according to the Client:servlet container contract, the
servlet creation and inialization is done by the container
which will differ for different container provider.
So u can't use constructors to create servlets.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the different session tracking techniques?
What is servlet in simple terms?
What is servlet and list its types?
What is dispatcher servlet?
What is the advantage of Servlets when compared with other server side technologies?
What is servletconfig?
What are its drawbacks of cgi?
Explain the differences between jsp and servlet.
Why do we have servlet listeners?
What methods do you use in servlet - applet communication?
Explain the features are in servlet 3?
How can we invoke another servlet in a different application?
Define context initialization parameters.
When a servlet accepts a call from a client, it receives two objects. What are they?
What is the structure of the http response