用监听器实现的简单的网络在线人员列表
监听器:
在线成员列表:<%@ page contentType="text/html;charset=GBK"%><%@ page import="java.util.*"%><html><head><title>www.baidu.com</title></head><body><%request.setCharacterEncoding("GBK");%><%Set all = (Set)this.getServletContext().getAttribute("online");Iterator iter = all.iterator();while(iter.hasNext()){%><h3><%=iter.next()%></h3><%}%></body></html>
本页面用监听器实现了在线人员的列表显示,登陆后,session-timeou 为1分钟
在监听器中,实现了ServletContextListener,HttpSessionAttributeListener,HttpSessionListener 的个别方法,以实现人员的登陆与注销.
只在了解监听器(学习中.........)