What are the life-cycle methods of JSP?

By: Karthik Viewed: 169 times  Printer Friendly Format    


Answer: Life-cycle methods of the JSP are:
a) 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.
b)_jspService(): The container calls the _jspservice() for each request and it passes the request and the response objects. _jspService() method cann't be overridden. 
c) jspDestroy(): The container calls this when its instance is about to destroyed.
The jspInit() and jspDestroy() methods can be overridden within a JSP page.

Most Viewed Articles (in Interview )

Tell me something about J2EE component?

What is the difference between JTS and JTA?

What is the difference between jsp:include page and @ include file?

Interview Question: What is Action Class?

Interview Question: What is the difference between EAR, JAR and WAR file?

What is Deployment Descriptor?

Explain garbage collection?

Interview Question: What is ActionForm?

Interview Question: What about JSTL and JavaServer Faces ?

Interview Question: Why are some of the class and element names counter-intuitive?

Interview Question: What is the difference between ejbCreate() and ejbPostCreate?

Interview Question: What is difference between EJB 1.1 and EJB 2.0?

Interview Question: What is lazy loading?

Interview Question: What is the difference between find and select methods in EJB?

Interview Question: What is the difference between Message Driven Beans and Stateless Session beans?

Latest Articles (in Interview)

Comment on this tutorial