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 is Client-Server Computing?

1897


How httpservlet is different from the genericservlet?

566


What is ServletConfig object?

610


How do we translate jsp?

578


How can you start a jta transaction from a servlet deployed on jboss?

674






What is the use of httpservletresponsewrapper?

534


Why don't we write a constructor in a servlet?

592


How servlets are deployed in java?

546


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

610


What is the element?

590


What is java servlet?

612


What is servlet and its life cycle?

572


What is the servlet?

623


How do I support both get and post from the same servlet?

696


What is cookies in servlet with example?

520