Total members 9952 | Gratitudes |It is currently Sat Feb 11, 2012 2:37 pm Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Question
 Question subject: Explain the life cycle methods of a Servlet.
PostPosted: Fri Nov 07, 2008 1:06 pm 
Offline
Newbie
User avatar

Joined: Wed Mar 28, 2007 7:31 pm
Posts: 14
Has thanked: 0 time
Have thanks: 0 time

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.

_________________
best for you
yours, Mahmoud
http://www.templatesdragon.com


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 Which methods is best for SEO?  Google  Gabrial  5
 methods with variable arguments list  Java examples  msi_333  1
 Calling Overloaded Methods  Java  Anonymous  0
 Servlet & JSP  Servlets / JSP  Anonymous  1
 Download a PDF file using JSP or servlet  Servlets / JSP  cororo  6

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team