package smp;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;
public class SampleListener implements HttpSessionAttributeListener {
public void attributeAdded(HttpSessionBindingEvent ev) {
HttpSession session = ev.getSession();
ServletContext sc = session.getServletContext();
sc.log("追加属性名:" + ev.getName() + " 追加した属性値" + ev.getValue());
}
public void attributeRemoved(HttpSessionBindingEvent ev) {
HttpSession session = ev.getSession();
ServletContext sc = session.getServletContext();
sc.log("削除属性名:" + ev.getName() + " 削除した属性値" + ev.getValue());
}
public void attributeReplaced(HttpSessionBindingEvent ev) {
HttpSession session = ev.getSession();
ServletContext sc = session.getServletContext();
sc.log("変更属性名:" + ev.getName() + " 変更した属性値" + ev.getValue());
}
}
|