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 )

Explain garbage collection?

What is Collection API?

Question: Difference between forward and sendRedirect in JSP?

Differentiate between .ear, .jar and .war files.

Interview Question: What is re-entrant. Is session beans reentrant. Is entity beans reentrant?

Interview Question: Write code of any Action Class?

What is the difference between interface and abstract class?

Interview Question: What are the call back methods in Entity bean?

Question: How would you go about analyzing performance of an application?

Explain the new Features of JDBC 2.0 Core API?

Interview Question: What is Message Driven Bean?

What is similarities/difference between an Abstract class and Interface?

Interview Question: What is Deployment descriptor?

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

What is the difference between Session Bean and Entity Bean?

Latest Articles (in Interview)