Showing the life cycle of jsp using jspInit and jspDestroy
<%!
int num;
int count;
public void jspInit()
{
count++;
num = 10;
}
public void jspDestroy()
{
count--;
num = 0;
}
%>
<%
out.println("The number is " + num + "
");
out.println("The counter is " + count + "
");
%>