springboot session監聽
阿新 • • 發佈:2018-11-22
配置
package com.***.config; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; import javax.annotation.Resource; import javax.servlet.annotation.WebListener; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; import java.util.List; /** * session 監聽器 * * @author imsjw * @Date Created in 23:05 2018/7/31 */ @Slf4j @WebListener public class SessionListener implements HttpSessionListener { @Override public void sessionCreated(HttpSessionEvent se) { HttpSession session = se.getSession(); } @Override public void sessionDestroyed(HttpSessionEvent se) { } }