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 is the structure of the http response
What are different methods of session management in servlets?
What is cgi?
How can the session in servlet be destroyed?
How can we upload the file to the server using servlet?
What are the different methods involved in the process of session management in servlets?
Differentiate between the get and post method
How to get the actual path of servlet in server?
Explain the methods of request dispatcher in servlet?
What are the benefits of using servlet over cgi?
Is servlet a server side scripting language?
The code in a finally clause will never fail to execute, right?
What are the uses of servlet and what is servlet chaining?
Which protocol will be used by browser and servlet to communicate
What are the steps that are involved in using the httpservlet class?