Answer Posted / sivasubramanian.k
It is similar to the lifecycle of a servlet only,
They are:
jsp:init()
jsp:service()
jsp:destroy()
The init() method initializes the servlet within jsp and
must be called before the servlet can service any requests.
In the entire life of a servlet, the init() method is
called only once.
After initialization, the servlet can service client-
requests. Each request is serviced in its own separate
thread. The container calls the service() method of the
servlet for every request. The service() method determines
the kind of request being made and dispatches it to an
appropriate method to handle the request. The developer of
the servlet must provide an implementation for these
methods. If a request for a method that is not implemented
by the servlet is made, the method of the parent class is
called, typically resulting in an error being returned to
the requester
.
Finally, the container calls the destroy() method which
takes the servlet out of service. The destroy() method like
init() is called only once in the lifecycle of a Servlet.
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What is a “stateless” protocol ?
Is null a string in java?
What are the legal operands of the instanceof operator?
Can each java object keep track of all the threads that want to exclusively access it?
What will happen if static modifier is removed from the signature of the main method?
What is classes in java?
What is assembly language?
Does string isempty check for null?
What is the same as procedures?
What does the “static” keyword mean? Can you override private or static method in java?
Can we use return in constructor?
What are abstract methods in java?
What is the difference between throw and throws keywords?
Why enumeration is faster than iterator?
Is string a wrapper class?