统计在线人数
来源:互联网 发布:config sae.php 编辑:程序博客网 时间:2024/06/04 20:08
通过session
监听统计在线人数:
实现HttpSessionListener监听
public class SessionCounter implements HttpSessionListener{ private static int activeSession = 0; @Override public void sessionCreated(HttpSessionEvent ss) { activeSession++; } @Override public void sessionDestroyed(HttpSessionEvent ss) { if (activeSession > 0) { activeSession--; } } // 获取在线人数 public static int getSession() { return activeSession; }}
注册监听:
<listener> <listener-class>com.guo.hui.shiro.SessionCounter</listener-class> </listener>
jsp页面引用:
在线人数为:<%=com.guo.hui.shiro.SessionCounter.getSession()%>
阅读全文
0 0
- 在线人数统计
- HttpSessionListener统计在线人数
- 在线人数统计
- 如何统计在线人数
- HttpSessionListener统计在线人数
- HttpSessionListener统计在线人数
- HttpSessionListener统计在线人数
- 统计在线人数
- HttpSessionListener统计在线人数
- 在线人数统计方法
- 统计在线人数
- HttpSessionListener统计在线人数
- jsp在线人数统计
- 统计在线人数Web
- httpSessionListener统计在线人数
- 在线统计人数
- 在线人数统计所在位置
- 在线统计人数
- 学习资料参考:从深度学习到自然语言处理
- 一键配置ss脚本
- 关于类重载前置++和后置++的骚操作
- Wormholes
- Mac node版本管理nvm command not found
- 统计在线人数
- Ubuntu 14.04 下安装Qt5 并配置开发环境(终端下使用)
- HDU 1071 The area
- C++中的static关键字
- vue2+vuex+vue-router 快速入门(五) vuex 介绍
- 学习总结(二)
- go遍历文件夹和文件
- sftp常用命令介绍
- 【UE4 shader】防护盾shader