Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
javax.servlet.http.HttpSessionListener
public void sessionCreated(HttpSessionEvent se)
public void sessionDestroyed(HttpSessionEvent se)
package com.mypackage;
import javax.servlet.http.*;
import java.io.*;
public class SessionCleanUp implements HttpSessionListener {
public void sessionCreated(HttpSessionEvent se) {
/* Do any session initialization */
}
public void sessionDestroyed(HttpSessionEvent se) {
/* Clean-up Session */
HttpSession session = se.getSession();
File userFile = session.getAttribute("userFile");
if (userFile != null) {
try {
userFile.delete();
}
catch (Exception e) {
/* Do any error-handling */
}
}
}
}
<listener>
<listener-class>com.mypackage.SessionCleanUp</listener-class>
</listener>