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
Why are servlets used?
How is the get () method different from the post() method?
What is the process for chaining servlet?
Which event is fired at the time of session creation and destroy?
What's the use of servletcontext?
What are the key methods that are involved in processing of http servlets?
What are different methods of session management in servlets?
Difference between doget and dopost?
Explain web application directory arrangement?
What is meant by a web application
What do you mean by interservlet communication?
What is the difference between the http servlet and generic servlet?
What is a servlet context?
Explain the features are in servlet 3?
What are different ways for authentication of servlet?