how a servlet is instantiated, whether the container calls
init() or by calling any other method? please somebody reply..

Answer Posted / ashutosh

Servlet is instantiated by servlet container by calling
method Class.forName(Servlet class name).newInstance();

First of all Servlet Container looks into the
deployment descriptor(web.xml) .It looks the definition of
Servlet.And Than instantiate it by calling
Class.forName(Servlet class name).newInstance();

Is This Answer Correct ?    19 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How the JSP file will be executed on the Server side?

863


What is difference between jsp and servlet?

872


What is a servlet context?

811


Which interface must be implemented by all servlets?

1023


Explain the servlet filter.

713


What are the types of servlets? Explain

907


Why are http servlets used in programming?

738


What is the use of httpservletrequestwrapper and httpservletresponsewrapper?

757


What is servlet api used for conneting database?

945


Describe some assignments that are executed by servlet container?

782


Can we use threads in Servlets?

834


What is the procedure of invoking different servlet in a different application?

761


What is a deployment descriptor?

827


Why servlet is faster than jsp?

759


What is pure servlet?

897