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 do you mean by chaining in servlet?
What are the disadvantages of storing session state in cookies?
What are the ways to handle multi-threading in servlets?
Explain the lifecycle of a servlet?
What do you mean by scope object and what are its types?
What is the use of servlet wrapper classes?
How many servlet objects are created?
Can we get PrintWriter and ServletOutputStream both in a servlet?
What is difference between server and servlet?
What do you mean by the servlet chaining?
What are the uses of servlets?
What is a web application and what is it’s directory structure?
What are the functions of Servlet container?
Explain the working of service() method of a servlet.
What are sessions in servlets?