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 / gaurav agrawal

If we initialize the servlet via constructor then we cant
access the ServletConfig object at the time of
initialization.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is generic servlet class?

794


What is meant by Servlet? What are the parameters of service method?

796


What is servlet lazy loading?

887


What is the difference between the http servlet and generic servlet?

860


What is the difference between the servlets and cgi programs?

733


How is a servlet implemented in code?

776


How do you invoke a servelt?

822


Define context initialization parameters.

779


Explain web container.

785


What do you mean by request dispatcher in servlet? Also explain its methods.

833


What is servlet in simple terms?

774


How do we call one servlet from another servlet?

754


What is the difference between sendredirect() and forward() in a servlet?

722


How do you configure a centralized error handler in servlets?

748


Which event is fired at the time of project deployment and undeployment?

1045