What are the life-cycle methods of JSP?

By: Karthik Viewed: 1415 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 )

What is Deployment Descriptor?

What is Collection API?

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

Why J2EE is suitable for the development distributed multi-tiered enterprise applications?

What is the difference between jsp:forward and response.sendRedirect(url),?.

Interview Question: How is the MVC design pattern used in Struts framework?

Interview Question: Who makes the Struts?

Interview Question: Why do we need Struts?

Interview Question: How do I install Struts?

Interview Question: Does Struts include its own unit tests?

Interview Question: What about JSTL and JavaServer Faces ?

Interview Question: Can I invoke Runtime.gc() in an EJB?

Interview Question: Why does EJB needs two interfaces(Home and Remote Interface)?

Interview Question: What is the difference between sessioncontext and entitycontext?

Interview Question: Can i map more than one table in a CMP?

Latest Articles (in Interview)

Comment on this tutorial