Programming Tutorials

What are the life-cycle methods of JSP?

By: Karthik in Interview Tutorials on 2012-06-16  

Answer: Life-cycle methods of the JSP are:

  1. 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.
  2. _jspService(): The container calls the _jspservice() for each request and it passes the request and the response objects. _jspService() method cann't be overridden. 
  3. jspDestroy(): The container calls this when its instance is about to destroyed.

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

Add Comment

* Required information


No comments yet. Be the first!

Most Viewed Articles (in Interview )

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

Interview Question: What is Deployment descriptor?

Interview Question: What is EJB container?

Explain the user defined Exceptions?

Interview Question: What is EJB client JAR file?

What is Collection API?

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

What is difference between Java Bean and Enterprise Java Bean?

What do you understand by a container in J2EE?

What are Access Specifiers available in Java?

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

Interview Question: Does Struts include its own unit tests?

Types of Interviews

Question: What is the directory structure of a web application?

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

Latest Articles (in Interview)