/**
* @description: 监听器
* @author: Lawrence
* @create: 2019-03-18 10:35
* @Version: 2.0
**/
@Component
@ComponentScan
public class Listerner implements HttpSessionListener {
private static int online = 0;
@Override
public void sessionCreated(HttpSessionEvent se) {
System.out.print("创建session,当前在线人数为:"+online+"\n");
online++;
}
@Override
public void sessionDestroyed(HttpSessionEvent se) {
System.out.print("销毁session"+"/n");
}
}
转载于:https://www.cnblogs.com/-llf/p/10550926.html