What are the life-cycle methods of JSP?

By: Karthik 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 types of comments are available in the JSP?

Interview Question: Does Struts include its own unit tests?

Interview Question: Is there a particularly good IDE to use with Struts ?

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

Interview Question: Do ActionForms have to be true JavaBeans?

Interview Question: What are the optional clauses in EJB QL?

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

Interview Question: What is local interface. How values will be passed?

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

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

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

What are implicit Objects available to the JSP Page?

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

Interview Question: What is Action Class?

Interview Question: Who wrote Struts?

Latest Articles (in Interview)

Comment on this tutorial