在HttpSessionListener 中调用类方法

来源:互联网 发布:海南七星彩缩水软件 编辑:程序博客网 时间:2024/06/06 20:44
 
 
public class SessionListener implements HttpSessionListener {
public void sessionCreated(HttpSessionEvent se) {}public void sessionDestroyed(HttpSessionEvent event) {HttpSession ses = event.getSession();ServletContext application = ses.getServletContext(); ApplicationContext springCtx = WebApplicationContextUtils.getWebApplicationContext(ses.getServletContext());   //获取使用类的实体LwUserInfoLogService lwUserInfoLogService = (LwUserInfoLogService)(springCtx.getBean("lwUserInfoLogService"));  //方法调用   lwUserInfoLogService.getLwUserInfoLoginLog(logins); }}