Life Cycle of servlets?

Answer Posted / prashant

1> Server loads the servlet.
2> Server creats one or more instances of the servlet
3> Server calls the init()method of each Servlet instance
4> Servlet request is received
5> Servlet service()method processes the request
6> Servlet calls the service()method of the servlet instance
7> Servlet service()method then process the request & send
the output to the client
8> Servlet waits until next request is received (if yes
continue from step no-4 )
9> Servlet is unloaded by the server by calling the destroy
()method

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between CGI and Servlet?

579


What are the different session tracking techniques?

670


Does servlet have main method?

680


Explain the role of dispatcherservlet and contextloaderlistener.

601


What is the procedure for initializing a servlet?

543






How we can call a jsp from the servlet?

529


Explain how to improve Servlet Performance?

594


What do you mean by chaining in servlet?

566


What are some advantages of storing session state in cookies?

589


What is the purpose of dispatcherservlet properties?

506


request parameter how to find whether a parameter exists in the request object?

564


Write a simple servlet program to print the contents of html.

539


Can we use the constructor, instead of init(), to initialize servlet?

578


What are advantages of servlets over cgi?

622


When servlet object is created?

594