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
1000

Comments

No comments yet. Be the first!

Most Viewed Articles (in Interview )

The output of System.out.println(5>>2) in Java

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

Interview Question: What is EJB container?

How to define an Interface?

Interview Question: What is abstract schema?

Explain the Encapsulation principle.

Interview Question: If the framework doesn't do what I want, can I request that a feature be added?

What do you understand by JTA and JTS?

Interview Question: Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?

Interview Question: Does Struts include its own unit tests?

Interview Question: How many EJB Objects are created for a Bean?

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

Getting started with Interview

What do you understand by a J2EE module?

What types of comments are available in the JSP?

Latest Articles (in Interview)