Back to Top

Saturday, 4 February 2012

J2EE: SERVLET: Servlet Life Cycle

  Life cycle of a servlet starts when its first load in the memory space in web server and ends when unloaded from the server memory. we can divide this in 3 steps.


  • Server loads the servlet class.
  • Creates an instance for the servlet class.
  • Server initializes the instance by calling init() method.

  • Server creates a request & a respond object based on the client's request.
  • Invokes the service() method of the servlet, passing the request respond object.
  • service() method process the request and use the respond object to create the client respond.
  • service() method can invoke can also invoke other methods like doGet(), doPost(), doDelete(), doOptions(), doPut() and doTrace().

  • Server calls the destroy() method to relinquish any resources such as file handles that are allocated to that servlet. destroy() method is invoked once in a servlet's life time.
  • Then the server unload the servlet and its objects, and it's memory can be garbage collected.

    Describes the Servlet Life Cycle within Web container or Web Server

                       *Unavailable exception thrown       *Initialization failed

    Anijit Sarkar

    64 Responses to “ J2EE: SERVLET: Servlet Life Cycle ”

    Jaydeep said...
    26 February 2012 at 13:26

    Its really helpful!!


    anij said...
    5 March 2012 at 02:00

    Thanks for visiting! :)


    namastu said...
    19 April 2012 at 01:13

    Thanks for sharing the information i found it very useful.

    Thanks again..


    anij said...
    19 April 2012 at 22:13

    @namastu

    you r most welcome my friend!!


    Asif said...
    6 September 2012 at 18:00

    its great yar !


    Asif said...
    6 September 2012 at 18:02

    have u any interest in data structures using c++


    Java Tutorials Blog said...
    22 December 2012 at 10:06

    very nice pictorial demonstration of servlet life-cycle. but remember that the destroy method won't be invoked if server crashes.


    tb said...
    11 September 2013 at 23:16

    ... when is the servlet loaded and unloaded? When the container (say Tomcat) gets started and shut down? ... or restarted?


    nasir husain said...
    11 September 2014 at 13:11

    important servlet interview questions with answer
    http://www.itsoftpoint.com/?page_id=2425


    nasir husain said...
    11 September 2014 at 13:14

    recently asked important servlet interview questions with answer
    http://www.itsoftpoint.com/?page_id=2425


    Michael Hussey said...
    19 August 2016 at 15:45



    Great Blog Thanks.

    Here You Can Find Your First Round Interview question For Job .

    Struts Interview Questions

    OOPs Interview Questions

    JSP Interview Questions


    Naviya Nair said...
    24 October 2016 at 15:13

    I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Java 8 Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai Java Training Institutes

    Java Training Institutes in Chennai Java Training in Chennai


    Naviya Nair said...
    24 October 2016 at 15:21

    I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Java 8 Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai Java Training Institutes

    Java Training Institutes in Chennai Java Training in Chennai


    Naviya Nair said...
    24 October 2016 at 15:29

    I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

    Online Java Training Java 8 Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai Java Training Institutes

    Java Training Institutes in Chennai Java Training in Chennai


    Lucky Srivastava said...
    1 May 2017 at 15:12

    Hey Nice blog,Thanks for sharing this blog.!!!

    Embedded system training in lucknow

    Best python training in lucknow

    php industrial training in Lucknow

    Live projects training in Lucknow

    B-tech projects in Lucknow


    santhosh kumar said...
    3 May 2017 at 12:20

    The blog gave me idea about the servlet and The life cycle of servelet are explained in an easy and an understandable manner Thanks for sharing this post
    Java Training in Chennai


    sunitha vishnu said...
    17 May 2017 at 11:01

    This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharng this information,this is useful to me...
    Android training in chennai
    Ios training in chennai


    Karthika Shree said...
    19 May 2017 at 10:55

    It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.
    Java Training in Chennai


    Reena raj said...
    19 May 2017 at 13:28

    Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing..
    Web Design Company
    Web Development Company


    Riyas Raqim said...
    28 May 2017 at 17:08

    perfect explanation about java programming .its very useful.thanks for your valuable information. java training in chennai | java training in velachery


    preethi s said...
    20 June 2017 at 14:51

    Thanks a lot! You made a new blog entry to answer my question; I really appreciate your time and effort.And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things
    java training institutes in chennai | java j2ee training institutes in velachery


    preethi s said...
    23 June 2017 at 16:14

    Thanks a lot! You made a new blog entry to answer my question; I really appreciate your time and effort.
    Thank u so much .

    java training in chennai |
    java training institutes in chennai


    preethi s said...
    8 July 2017 at 10:27

    Thanks a lot! You made a new blog entry to answer my question; I really appreciate your time and effort.
    java training in chennai |
    java training institutes in chennai


    MANIKANDAN R said...
    3 August 2017 at 12:58

    Nice to read this article.... Thanks for sharing.....
    Android Training


    meena kumari said...
    20 September 2017 at 16:09

    nice blog. thanks for sharing valuable information. It’s really good.Any one looking software courses nareshit is the best offline and online software training institute in Hyderabad and Chennai.


    Linux Training India said...
    19 October 2017 at 12:59

    Great Article, thank you for sharing this useful information!!

    Linux Online Training India
    Online devops Training India
    Online Hadoop admin Training India


    suresh H said...
    2 December 2017 at 14:51

    You have stated definite points about the technology that is discussed above. The content published here derives a valuable inspiration to technology geeks like me. Moreover you are running a great blog. Many thanks for sharing this in here.
    Informatica Training in Chennai
    Python Training in Chennai
    AngularJS Training in Chennai


    Richard Swayar said...
    12 March 2018 at 16:59

    Australia Best Tutor is one of the best Online Assignment Help providers at an affordable price. Here All Learners or Students are getting best quality assignment help with reference and styles formatting.

    Visit us for more Information

    Australia Best Tutor
    Sydney, NSW, Australia
    Call @ +61-730-407-305
    Live Chat @ https://www.australiabesttutor.com




    Our Services

    Online assignment help
    my assignment help Student
    Assignment help Student
    help with assignment Student
    Students instant assignment help


    john kevin said...
    16 April 2018 at 14:58

    Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.

    Best Java Training Institute Chennai


    Dhileepan K said...
    27 June 2018 at 17:00

    Really informative blog.I got some valuable information from this. Keep posting

    Java Training in Chennai | Java Training Institute in Chennai


    preeti verma said...
    28 June 2018 at 16:45

    Best MCA

    colleges in noida

    Best MSC IT

    colleges in noida

    Best M

    TECH colleges in noida


    Ananya Krishnan said...
    19 July 2018 at 19:56

    Learn how our role-based and specialty certifications help you demonstrate your deep AWS knowledge. Credo Systemz provides the best AWS Training to get your certifications easily.

    AWS is designed to allow application providers, ISVs, and vendors to quickly and securely host your applications. Credo Systemz provides the best AWS Training to get your certifications easily.
    aws training in chennai with placement | aws authorized training partner in chennai


    Regu said...
    21 July 2018 at 15:28

    Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.

    Python Training in electronic city

    DataScience with Python Training in electronic city

    AWS Training in electronic city

    Big Data Hadoop Training in electronic city

    Devops Training in electronic city


    Riya karakoti said...
    27 July 2018 at 11:39

    Really a good post, thanks for sharing .keep it up.

    Best Web Design Training Institutes in Noida

    Best Hadoop Training Institutes In Noida

    Best Digital Marketing Training Institute in Noida

    Sap Training Institute in Noida

    Best Java Training Institute in Noida

    SAP SD Training Institute in Noida

    Best Auto CAD Training Institute In Noida


    Arvind Rawat said...
    10 August 2018 at 11:31

    Each department of CAD have specific programmes which, while completed could provide you with a recognisable qualification that could assist you get a job in anything design enterprise which you would really like.

    AutoCAD training in Noida

    AutoCAD training institute in Noida


    Best AutoCAD training institute in Noida


    Dipanwita said...
    10 August 2018 at 15:11

    I loved this blog. java training in chennai


    sumant kumar said...
    29 August 2018 at 18:12

    I found best article.thank you for sharing useful info.
    visit
    web programming tutorial
    welookups


    nancy said...
    6 September 2018 at 22:13

    Your blog is very useful for me, Thanks for your sharing.


    Anexas Europe said...
    7 September 2018 at 13:56


    It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.

    Digital Marketing Training in Mumbai

    Six Sigma Training in Dubai

    Six Sigma Abu Dhabi


    nancy said...
    20 September 2018 at 14:00

    Nice blog with excellent information. Thank you, keep sharing


    nancy said...
    21 September 2018 at 19:31

    Wonderful article, very useful and well explained.


    MSBI Training in Hyderabad



    Deepika Analy said...
    24 September 2018 at 08:47

    Great Article...Thanks for sharing the best information.It was so good to read and useful to improve my knowledge as updated one.

    Android Training
    Android Training in Chennai


    gowthunan said...
    10 October 2018 at 13:03

    Really cool post, highly informative and professionally written and I am glad to be a visitor of this perfect blog, thank you for this rare info!
    fire and safety course in chennai


    w3 Webschool said...
    15 October 2018 at 09:09

    Excellent informative blog, Thanks for sharing.
    SEO Training


    Bee Yes said...
    20 October 2018 at 11:02

    Amazing Article ! I have bookmarked this article page as i received good information from this. All the best for the upcoming articles. I will be waiting for your new articles. Thank You ! Kindly Visit Us @ Coimbatore Travels | Ooty Travels | Coimbatore Airport Taxi


    Deepika Analy said...
    23 October 2018 at 15:47

    This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.

    Microstrategy Training
    Core Java Training
    JEE Training in Chennai


    Bee Yes said...
    31 October 2018 at 13:49

    Amazing Article ! I have bookmarked this article page as i received good information from this. All the best for the upcoming articles. I will be waiting for your new articles. Thank You ! Kindly Visit Us @ Coimbatore Travels | Ooty Travels | Coimbatore Airport Taxi


    Anbarasan14 said...
    13 November 2018 at 13:08

    Nice post. Thanks for sharing such a recent updates.

    Best Spoken English Chennai
    Spoken English Chennai
    Best English Coaching Center in Chennai
    Best English Course in Chennai
    Best Spoken English Classes near me
    Spoken English Institutes in Chennai
    English Spoken Centre Chennai


    Sadhana Rathore said...
    22 November 2018 at 17:46

    Learned a lot from your blog, keep sharing more like this.
    Python Training in Chennai
    Python classes in Chennai
    Machine Learning Course in Chennai
    Azure Training in Chennai
    R Training in Chennai
    UiPath Training in Chennai


    Roja Priya said...
    1 December 2018 at 14:57

    Thank you for sharing your article. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.

    best openstack training in chennai | openstack course fees in chennai | openstack certification in chennai | openstack training in chennai velachery


    Sharmi Ammu said...
    1 December 2018 at 17:00

    Thanks for the blog loaded with so many information.


    Selenium Training in Chennai
    Best Selenium Training Institute in Chennai
    ios developer training in chennai
    .Net coaching centre in chennai
    French Classes in Chennai
    Big Data Training in Chennai
    Best JAVA Training in Chennai
    SEO Training Center in Chennai
    SEO Institutes in Chennai


    Vicky Ram said...
    5 December 2018 at 13:24

    Awesome post, continue sharing more like this.

    Article submission sites
    Education


    Anjali Siva said...
    6 December 2018 at 18:07

    Excellent and useful blog admin, I would like to read more about this topic.
    DevOps certification Chennai
    DevOps Training in Chennai
    DevOps Training near me
    DevOps Training institutes in Chennai
    AWS Training in Chennai
    AWS course in Chennai


    Riya Raj said...
    7 December 2018 at 16:00

    Outstanding information!!! Thanks for sharing your blog with us.
    Spoken English Class in Coimbatore
    Best Spoken English Classes in Coimbatore
    Spoken English in Coimbatore
    Spoken English Classes
    English Speaking Course


    Praylin S said...
    13 December 2018 at 17:28

    Great post! Thanks for sharing.
    Mobile Testing Training in Chennai | Mobile Testing Course in Chennai | Mobile Automation Testing Training in Chennai | Mobile Testing Training | Mobile Application Testing Training | Mobile Apps Testing Training | Mobile Application Testing Training in Chennai | Mobile Appium Training in Chennai


    Madduri Jagadeesh said...
    4 January 2019 at 14:34

    best article with nice information thank you
    DevOps Training in Hyderabad
    Salesforce Training in Hyderabad
    SAP ABAP Online Training
    SEO Training in Hyderabad


    jefrin adams said...
    8 January 2019 at 15:07

    Great article keep posting daily
    Machine learning training in chennai


    Digital Floats said...
    8 January 2019 at 18:32

    Great Article. Thanks for sharing info.

    Digital Marketing Course in Hyderabad

    Digital Marketing Training in Hyderabad

    AWS Training in Hyderabad

    Workday Training in Hyderabad


    jefrin adams said...
    10 January 2019 at 16:20

    Read this article very useful for me
    best azure certification training in chennai


    Shanthi Cabs said...
    17 January 2019 at 11:31

    Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live. I have bookmarked more article from this website. Such a nice blog you are providing ! Kindly Visit Us @ Best Travels in Madurai | Tours and Travels in Madurai | Madurai Travels


    tanmay chaubey said...
    29 January 2019 at 15:47

    Its really nice and informative.. Thanks for sharing

    Microsoft Azure Training institute in Noida,

    AWS Training Institute in Noida sector 16,

    Cloud Computing Training Institute in noida sector 16,

    Data science training institute in noida sector 16,

    Data Science With machine learning training Institute in Noida sector 16,

    Data Science With python training Institute in Noida sector 16,

    Web-designing Training Institute in Noida sector 16,


    tanmay chaubey said...
    29 January 2019 at 15:48

    Its really nice and informative.. Thanks for sharing

    software-testing Training Institute in Noida sector 16,

    Digital Marketing Training Institute in noida sector 16,

    hadoop Training Institute in noida sector 16,

    Java Training Institute in noida sector 16,

    linux Training Institute in noida sector 16,

    node.js Training Institute in noida sector 16,

    openstack Training Institute in noida sector 16,

    Oracle DBA Training Institute in noida sector 16,


    tanmay chaubey said...
    29 January 2019 at 15:49

    Its really nice and informative.. Thanks for sharing

    Php Training Institute in noida sector 16,

    PlSql Training Institute in Noida sector 16,

    Python Training Institute in Noida sector 16,

    RPA Training Institute in Noida sector 16,

    Salesforce Training Institute in Noida sector 16,

    Sap fico Training Institute in Noida sector 16,

    ERP Sap mm Training Institute in Noida Sector 16,

    Sap Training Institute in Noida Sector 16,

    SAS Training Institute in Noida Sector 16,

    Blue Prism Training Institute in Noida,


    jenifer irene said...
    19 February 2019 at 12:40

    Very good information provided, Thanks a lot for sharing such useful information.
    Aviation Academy in Chennai
    Air hostess training in Chennai
    Airport management courses in Chennai
    Ground staff training in Chennai
    Aviation Courses in Chennai
    air hostess academy in Chennai
    Airport Management Training in Chennai
    airport ground staff training in Chennai


    Post a Comment

    Popular Posts

    All Rights Reserved JAVA INTERVIEW QUESTIONS | Privacy Policy | Anijit Sarkar
    blog links Web Directory Academics Blogs