sessionDestroyed 怎样在关闭页面时就调用,求详细方法!!!!!!!

Ace_m 2017-11-02 08:18:41
public void sessionDestroyed(HttpSessionEvent hse) {
HttpSession session=hse.getSession();
Student student=(Student)session.getAttribute("student");

Set<Student> onlineUsers=(Set<Student>)application.getAttribute("onlineusers");
onlineUsers.remove(student);
application.setAttribute("onlineusers", onlineUsers);

SqlSession sessions = SqlSessionFactoryUtil.getSqlSession();
INumDao idd=sessions.getMapper(INumDao.class);

idd.numjian();
sessions.commit();

}
想在关闭网页时调用写在sessionDestroyed中的方法
...全文
80 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧