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中的方法