Which method the Servlet container call to create the
instance of the servlet?

Answers were Sorted based on User's Feedback



Which method the Servlet container call to create the instance of the servlet?..

Answer / ravikiran(aptech mumbai)

After The successfull parsing of web.xml container will find
the particular class name which is mapped in web.xml and calls
class.forName(classname).newInstance() method.Then calls
init(ServletConfig config) of GenericServlet for
initializing the instance of the servlet.

Is This Answer Correct ?    35 Yes 1 No

Which method the Servlet container call to create the instance of the servlet?..

Answer / m.gangadhar from sathya techno

The ServletContainer is used default zero argument
constructor to create servlet instance then after it calls
init(ServletConfig cg) it internally calls init()for
initialization puposes.


Plz guys init() is not used for creation of servlet instance

Is This Answer Correct ?    26 Yes 2 No

Which method the Servlet container call to create the instance of the servlet?..

Answer / naveen kumar bandi

to create an instance of servlet servlet container calls
newInstance() method

Is This Answer Correct ?    20 Yes 3 No

Which method the Servlet container call to create the instance of the servlet?..

Answer / priyanjan

Servlet container invokes the init() method to create the
instance of servlet.

Is This Answer Correct ?    18 Yes 11 No

Which method the Servlet container call to create the instance of the servlet?..

Answer / pintu debnath

init() method is only used to initialize a servlet, and it
is called after the servlet instance has been created.

Is This Answer Correct ?    12 Yes 5 No

Which method the Servlet container call to create the instance of the servlet?..

Answer / ravikiran.chd

class.forName(classname).getInstance()

Is This Answer Correct ?    6 Yes 1 No

Which method the Servlet container call to create the instance of the servlet?..

Answer / samik bandyopadhyay

The init() method is only used to initialize an existing
servlet instance before it starts providing service to
requests, it's never used for creating a servlet instance.
I'm searching for the method which creates the servlet
instace. But I can assure that we can't create a servlet
instace, it's done by the container.

Is This Answer Correct ?    8 Yes 4 No

Which method the Servlet container call to create the instance of the servlet?..

Answer / kishore

servlet container calls the init() method to create servlet
instance

Is This Answer Correct ?    13 Yes 10 No

Which method the Servlet container call to create the instance of the servlet?..

Answer / priyanjan

servlet container creates the init() method

Is This Answer Correct ?    17 Yes 15 No

Which method the Servlet container call to create the instance of the servlet?..

Answer / deepak jenamani

servlet container calls the Class.instanceOf() method
to create a instance of servlet.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More Servlets Interview Questions

when the several requests comes to server..how it manage the requests

4 Answers   iGate,


What is lazy loading and what is Generic Servlet Class?

0 Answers  


What are the types of servlet?

0 Answers  


Servlet is pure java object or not?

0 Answers  


What are the phases of a servlet life cycle?

0 Answers  






Why jsp is better than servlet?

0 Answers  


What are the methods in HttpSession and their use?

3 Answers  


How can you use a servlet to generate a plain text instead of html?

0 Answers  


What is called Scriptlet?

0 Answers  


How we can call a jsp from the servlet?

0 Answers  


What are the differences between forward() method and sendredirect() methods?

0 Answers  


Which event is fired at the time of session creation and destroy?

0 Answers  


Categories