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

Describe servlet?

1049


How can the session in servlet can be destroyed?

1184


What is the difference in between the httpservlet and generic servlet?

1128


What is java servlet?

1059


What is the difference between get and post methods?

1055


What are different Authentication options available in Servlets.

1075


Why doesn’t a servlet include main()? How does it work?

1166


Which method is called when reference variable is passed in system.net?

2412


How do I know if java is running on linux?

1129


What's the use of servletcontext?

1146


When a client request is sent to the servlet container, how does the container choose which servlet to invoke?

1033


Can you create a deadlock condition on a servlet?

1085


How can we create deadlock situation in servlet?

1434


What is the default http method in the servlet?

1306


How can an existing session be invalidated?

1174