Hi,
When you servlet creates the image then set an attribut in this session indicating that it was created by ...
session.setAttribute("createdByaServlet",true);
and then you can just do this :
public void sessionDestroyed(HttpSessionEvent se) {
if(session.getAttribute("createdByaServlet")){
HttpSession s = se.getSession();
ServletContext sc = s.getServletContext();
File f = new File(sc.getRealPath("\\") + s.getId());
f.delete();
}
}
[Message sent by forum member 'b_faissal' (b_faissal)]
http://forums.java.net/jive/thread.jspa?messageID=357657