Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JSP Lifecycle chain

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know about JSP Lifecycle methods

Thank you,
srinivas
 
Ranch Hand
Posts: 47
MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


May be this will help you

A JSP page services requests as a servlet. Thus, the life cycle and many of the capabilities of JSP pages (in particular the dynamic aspects) are determined by Java Servlet technology. The life-cycle methods of the JSP are:

jspInit(): The container calls the jspInit() to initialize the servlet instance. It is called before any other method, and is called only once for a servlet instance.
_jspService(): The container calls the _jspService() for each request and it passes the request and the response objects. _jspService() method cann?t be overridden.
jspDestroy(): The container calls this when its instance is about to destroyed.

The jspInit() and jspDestroy() methods can be overridden within a JSP page.

These methods are generated after JSP page translated and compiled, the JSP pages's servlet follows the servlet life-cycle:

If an instance of the JSP page's servlet does not exist, the container
Loads the JSP page's servlet class
Instantiates an instance of the servlet class
Initializes the servlet instance by calling the jspInit method
The container invokes the _jspService method, passing request and response objects.

If the container needs to remove the JSP page's servlet, it calls the jspDestroy method.
 
Marshal
Posts: 67420
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also read this article.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic