When the methods init() and Distroy() will be called?
Answer Posted / 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 |
Post New Answer View All Answers
What is a web container and what is its responsibility?
Describe in brief RequestDespatcher?
Whether we can get deadlock situation in servlets?
Difference between get and post in java servlets?
What is Servlets and explain the advantages of Servlet life cycle?
Are Servlets Thread Safe? How to achieve thread safety in servlets?
Why is httpservlet declared abstract?
What is the use of httpservletrequestwrapper?
What are the common methods that are included in the http servlet class?
How many objects of a servlet is created?
What is servlet name in web xml?
What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?
What is the difference between 2 types of servlets?
Write a simple servlet program to print the contents of html.
What is the procedure of invoking different servlet in a different application?