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

Answer Posted / suraj kumar

The servlet is controlled by the container in which the servlet has been deployed. When a request is made to a servlet, its mapping is searched in web.xml. If mapping found then the container performs the following steps.
a.If an instance of the servlet does not exist, the Web container loads the servlet class.
b.Creates an instance of the servlet class.
c.Initializes the servlet instance by calling the init method

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by web applications? Explain web application directory arrangement?

725


What is the difference between 2 types of servlets?

853


Difference between httpservlet and generic servlets?

817


What is the element?

772


How can we perform any action at the time of deploying the project?

868


What is the directory structure of a war file?

899


What is cookie? Why is cookie used?

791


What is the difference between servlet and filter?

712


What is the difference between get and post methods?

775


How can we create deadlock situation in servlet?

1064


How can you create a session in servlet?

819


What are the types of protocols supported by httpservlet ?

921


Explain web application directory arrangement?

781


What is the difference between jsp and servlet life cycle?

937


How is a servlet implemented in code?

776