When the methods init() and Distroy() will be called?
Answer Posted / tulasi vani
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 |
Post New Answer View All Answers
Name the different ways of session tracking.
Why do we need a constructor in a servlet if we use the init method?
What do you mean by request dispatcher in servlet? Also explain its methods.
What are the differences between servlet context vs servlet config?
Why is init() method is used in servlets?
How to handle exceptions thrown by application with another servlet?
What is the use of send redirect () method?
How many objects of a servlet is created?
What is the disadvantage of cookies?
When a client request is sent to the servlet container, how does the container choose which servlet to invoke?
What are the types of an http request?
What do you mean by chaining in servlet?
What are all the protocols supported by httpservlet?
What is the major difference between servlet and applet?
Why do we use sendredirect() method?