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
What is meant by servlet? What are the parameters of the service method?
What is ServletConfig object?
Why is a constructor needed in a servlet even if we use the init method?
List some life cycle methods of a servlet.
What do you mean by cgi and what are its drawbacks?
What is the difference between encodeRedirectUrl and encodeURL?
What are the supporting protocol by HttpServlet ?
How to generate the server side programming and the advantages of it over the other languages?
What do you mean by session tracking?
What is webservlet?
Explain the difference between a web server and a web container?
If my browser does not support cookie, and my server sends a cookie instance what will happen?
What is servlet in tomcat?
How do you get the ip address of the client in servlet?
What is the disadvantage of cookies?