Giriş
Şu satırı dahil ederiz
import javax.servlet.http.HttpSessionIdListener;
Açıklaması şöyle
The HttpSessionIdListener interface is for receiving notification events about session id changes. The order in which its implementations are invoked is unspecified.Örnek
Şöyle yaparız
import javax.servlet.http.HttpSessionEvent;import javax.servlet.http.HttpSessionIdListener;import javax.servlet.annotation.WebListener;@WebListenerpublic class MyHttpSessionIdListener implements HttpSessionIdListener {@Overridepublic void sessionIdChanged(HttpSessionEvent event, String oldSessionId) {System.out.println("the session id was " + oldSessionId);}}
Hiç yorum yok:
Yorum Gönder