Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is servlet life cycle?

Answers were Sorted based on User's Feedback



what is servlet life cycle?..

Answer / rama

The three important functions that implement the life cycle
of servlet are init(),service(),destroy().
When a client/user specifies a request by entering the
URL in the browser the browser generates an HTTP request
for it and sends to the server.
On receiving the HTTP request the server maps a servlet
to this request. the servlet is then dynamically retrieved
and loaded in the memory.
The server now calls the init() method of the servlet.
Parameters can be sent to configure the servlet. This
method is called only once when the servlet is first
loaded.
When a request arrives for this servlet the server
invokes the service() method. this is the method which
handles all the HTTP requests and formulates HTTP response.
For every request service() method is called.
When the server decides to unload the servlet it calls
the destroy() method. Any resources which were used by the
servlet or any open files or any database connections can
be restored so that the memory used by these objects and
the servlet can then be garbage collected.

Is This Answer Correct ?    15 Yes 0 No

what is servlet life cycle?..

Answer / nalinscjp

Through out the time of execution of a Sevlet, there are
many methods which are important to noticed.

<a
href="http://servlet-jsp.blogspot.com/2010_03_01_archive.html">Read
here</a>

Is This Answer Correct ?    1 Yes 1 No

what is servlet life cycle?..

Answer / 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

More Servlets Interview Questions

How we can create war file in servlet?

0 Answers  


What's the advantages using servlets than using cgi?

0 Answers  


In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify

0 Answers  


can i call init() method in destroy() method of servlset. ?

5 Answers   IBM,


List some life cycle methods of a servlet.

0 Answers  


how the server will know its the same jsp page?

3 Answers   HCL,


can we use more than one controller in web application

3 Answers   IBM,


can i override service method

3 Answers   Intelligroup,


What's the difference between servlets and applets?

0 Answers  


What do you mean by scope object and what are its types?

0 Answers  


if we know the any consultancies, it will place in company work through consultancy(contract base). please help me I'm 2008 pass out java candidate...

1 Answers  


Difference between jakarta tomcat and apache Tomcat?

4 Answers   IBM,


Categories