Tiana,
If you are doing this cleanup when the App is ending then you don't want to
put the file info in the Session. Sessions are for data that lasts only as
long as a user's session lasts - Session scope. Since you're using
jspDestroy() i will assume you mean to give it Application scope. To achieve
this you can use something like:
public jspInit()
{
getContext().setAttribute("outfile1", ' BLA ');
getContext().setAttribute("outfile2, ' BLA ');
}
public jspDestroy()
{
filename = getContext().getAttribute("outfile1");
new File(filename).delete();
filename = getContext().getAttribute("outfile2");
new File(filename).delete();
}
Lee
>From: Tiana Zhang <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
> reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: How to overwrite jspdestroy() method?
>Date: Tue, 16 May 2000 15:54:13 -0500
>
>Hi,
>
>I'm trying to overwrite the jspDestroy() method to clean up files generated
>by
>my jsp pages. Can anyone tell me how to do this and where to put the
>method?
>
>I added a method in jsp page:
><%! public void jspDestroy() {
>
> Httpsession session = request.getSession();
> new File((String)session.getValue("outfile1")).delete();
> new File((String)session.getValue("outfile2")).delete();
> }
>
>%>
>
>The compiler complains unrecognized variable "request".
>
>Thanks much.
>
>Tiana
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets