What are the Lifecycle Methods of a JSP ?

A JSP has following lifecycle methods...

1. jspInit(): This method is invoked when the JSP is called for the first time. We can do initial setup for servicing a request in this method.

2. _jspService(): This method is used to serve every request of the JSP.

3. jspDestroy(): Once we remove a JSP from the container, we call this method. It is used for cleanup of resources like Database connections etc.



You May Interest

How Can We Take Thread Dump in Java ?

How Can We Improve the Performance of IdentityHashMap in Java ?

When Do You Use Exception or Error in Java ?

What is the Difference Between Queue and Stack Data Structures in ...

What is the Use of Interceptor Design Pattern in Java ?