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

What are the Differences Between Comparable and Comparator in Jav ...

What are the Different States of a Thread in Java ?

Why Do We Use JSP Instead of Servlet in Java ?

How Strategy Design Pattern is Different From State Design Patter ...

What are the Main Uses of Singleton Design Pattern in Java ?