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
how many jsp scripting elements are there and what are those?
What is called a session?
Explain the difference between a web server and a web container?
What is meant by a web application
What is the servletconfig object?
Explain in brief the directory structure of a web application?
Why do we have servlet filters?
What is the use of servlet context?
How to handle exceptions thrown by application with another servlet?
What is cgi and what are its drawbacks?
What is a deployment descriptor?
Which method is called when reference variable is passed in system.net?
Which protocol will be used by browser and servlet to communicate
What is difference between GenericServlet and HttpServlet?
What is difference between get and post method?