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...

Life Cycle of servlets?

Answer Posted / shakir khan

javax.servlet.Servlet interface defines 3 methods known as
life cycle.
Servlet intialisation takesplace every first time,it
receives a request and remains in memory till times out or
server shutdown

When first request came in for a servlet,servlet invoke
init() only once.

public void init(ServletConfig config)
{
}
Thereafter if any user wants requet,it will directly
executes the service().

public void service(ServletRequest req,ServletResponse res)
throws servletException,IOException
{
}
When server wants to remove the servlet from pool ,it will
executes the destroy().

public void destroy()
{
}

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use threads in Servlets?

1078


What are the various ways of session supervision in servlets?

945


What do you mean by a filter and how does it work?

898


What is httpservlet and how it is different from genericservlet?

1037


Write a command to get actual path of a servlet to the server?

968


What is servlet and how it works?

913


How printwriter is different from servletoutputstream?

951


What is a servlet context?

1085


What is the importance of init() method in Servlet ?

1033


What is the process for chaining servlet?

992


Given the request path below, which are context path, servlet path and path info?

987


I have a requirement Here we have a ResultSet object that will contain 50 records i need to print those recors in to a webpage(i.e; view according to MVC architectures that mybe servlet or jsp) . Here i need to print the records 10 per page that is 1 to 10 in page one and 11 to 20 in page two like remaining will be appeared in other pages we need to display those page numbers whenever we click on that page number we will go to that page and display 10 records like we will display 5 pages it is like this << 1 2 3 4 5 next >>

2903


What is called Scriptlet?

1054


What do you mean by chaining in servlet?

984


What is difference between GenericServlet and HttpServlet?

1063