Total members 11895 |It is currently Sun Dec 22, 2024 8:51 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Q: Explain the life cycle methods of a Servlet.

A: The javax.servlet.Servlet interface defines the three methods known as life-cycle method.
public void init(ServletConfig config) throws ServletException
public void service( ServletRequest req, ServletResponse res) throws ServletException, IOException
public void destroy()
First the servlet is constructed, then initialized wih the init() method.
Any request from client are handled initially by the service() method before delegating to the doXxx() methods in the case of HttpServlet.

The servlet is removed from service, destroyed with the destroy() methid, then garbaged collected and finalized.



_________________
Please recommend my post if you found it helpful


Author:
Newbie
User avatar Posts: 14
Have thanks: 0 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Explain the life cycle methods of a Servlet.
 Explain the life-cycle mehtods in JSP     -  
 Game Of Life 3D     -  
 Please Explain Little Bit More!     -  
 Explain ServletContext.     -  
 explain event handling in java     -  
 Which methods is best for SEO?     -  
 What Are Constructor Methods?     -  
 methods in ActionListener interface     -  
 JSP Passing Arrays to Methods     -  
 Calling Overloaded Methods     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com