| Java FAQ | ||
| JSP FAQ | ||
| Servlet FAQ | ||
XyzWs JSP FAQ:
How to overwrite the init and destroy method in a jsp page?
Printer-friendly version |
Mail this to a friend
|
Advertisement
|
How to overwrite the init and destroy method in a jsp page?
You can not override the The jspInit() and jspDestroy() methods are each executed just once during the lifecycle of a JSP page and are typically declared as JSP declarations:
<%!
public void jspInit() {
. . .
}
%>
<%!
public void jspDestroy() {
. . .
}
%>
The
<%!
public void jspDestroy() {
Httpsession session = request.getSession();
new File((String)session.getValue("outfile1")).delete();
new File((String)session.getValue("outfile2")).delete();
}
%>
But most of the time we don't override these life cycle methods. |