Answer Posted / anu
There are 3 methods in servlet life cycle:init(),service
(),destroy().
whenever servlets loads,init() method is invoked.init
()invokes only once in whole life cycle.then service()
method is invoked which handles all the Http requests and
correspondingly generate Http response.Finally service()
method is invoked for unloading the servlet.this method is
also invoked only once.
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?
Write a program to show the functionality of doget and dopost method?
What is the type of method for sending request from http server?
What are all the protocols supported by httpservlet?
What is cookie? Why is cookie used?
What is servlet and list its types?
Explain in brief the directory structure of a web application?
What is servlet and its types?
Given the request path below, which are context path, servlet path and path info?
What is the difference between forward () and sendredirect () functions in servlet? Explain
List out difference between a JavaBean from a Servlet?
What is the main purpose of java servlets?
What's the use of servletcontext?
Which event is fired at the time of project deployment and undeployment?
What is the major difference between servlet and applet?