When the methods init() and Distroy() will be called?
Answers were Sorted based on User's Feedback
The servlet life cycle included init() and destroy()(Small
d).
init() is called at the beginning of the servlet,it
performs certain one time activities which are required
during the lifetime of the servlet.It may be some
initialisation of variables or a database connection.
destroy() is called to destroy the servlet.Various
resources which are held by the servlet will be
released,database connections which were opened will be
closed.Later the servlet is destroyed.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / abhijitbaji
both init() and destroy() are called only once.
init() at the begining when servlet object is cerated.
destroy() when the servlet object is removed from server(at
shoutdown).
service() is called each time when request comes to servlet.
Is This Answer Correct ? | 2 Yes | 1 No |
What is servlet configuration?
what is the difference between?when we write the code in following manner? class One extends httpservlet { } and class One extends genericservlet { }
Explain Servlet Chaining ?
What are the advantages of cookies?
How will two or three servlets interact or communicate with each other?
Differentiate between the print writer and servlet output stream?
Which method is called when reference variable is passed in system.net?
What is Servlets and explain the advantages of Servlet life cycle?
What is called Session Tracking?
How do you deal property files in servlet?
How can you push data from an Applet to a Servlet?
Explain the methods of request dispatcher in servlet?