由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Who's online--JSP?
相关主题
question: how to implement thisRe: JPanel help!
关于Jsp timeoutRe: 有没有办法在browser第一次访问的时候知道是不是支持cookie?
java servlet httpsession问题求教简单的EJB问题
How to access ActiveX control in JSP or EJB?Stateful session bean到底有啥好处?
问一个J2EE和Tomcat问题想听本版对下面这段话的点评
JSP+SERVLET网站一般用下面方式来保存和传递变量和参数Help! J2ee online test?
session lost between JSP and Struts[合集] Are JSPs Dead?
关于RIAEclipse不能保存UTF-8文件?
相关话题的讨论汇总
话题: jsp话题: who话题: session话题: online话题: know
进入Java版参与讨论
1 (共1页)
w***f
发帖数: 46
1
Does anyone know how to implement a jsp program which can identify who's
online at the moment? I search for long time and can't find any jsp source
code.I want to know their number, ip address . Help appreciated!
Wu
g*****g
发帖数: 34805
2
Html is not persistent, you cannot know whether a user is online or not.
An approxmiation may look like this.
When you receive a request, update the user's last request time if he/she
is the DB, create new record if not(you have cookie, don't you).
Check every 5 minutes, remove those idle for 30 minutes or more from
Db. Assume users in DB are online.

【在 w***f 的大作中提到】
: Does anyone know how to implement a jsp program which can identify who's
: online at the moment? I search for long time and can't find any jsp source
: code.I want to know their number, ip address . Help appreciated!
: Wu

w***f
发帖数: 46
3
Thanks. As a request create a server session, I think it would be better to
check how many server session there are now and then compare their ip address
from request.Just don't know the details how to implement it. any example
codes?
I know this is a really tough and challenging question .Let'see who can finish
this task.Thanks.
Wu

【在 g*****g 的大作中提到】
: Html is not persistent, you cannot know whether a user is online or not.
: An approxmiation may look like this.
: When you receive a request, update the user's last request time if he/she
: is the DB, create new record if not(you have cookie, don't you).
: Check every 5 minutes, remove those idle for 30 minutes or more from
: Db. Assume users in DB are online.

l**d
发帖数: 42
4
哪用这么复杂?检查Session就是了。有的Session绑了用户(即login过),
则是login用户。没有绑定的,则是anonymous。

【在 g*****g 的大作中提到】
: Html is not persistent, you cannot know whether a user is online or not.
: An approxmiation may look like this.
: When you receive a request, update the user's last request time if he/she
: is the DB, create new record if not(you have cookie, don't you).
: Check every 5 minutes, remove those idle for 30 minutes or more from
: Db. Assume users in DB are online.

l**d
发帖数: 42
5
顺便说一下,HttpSessionContext出于安全原因已经deprecated了。不过
现在大多数Application都还支持。如果不用它,可以用Session Event Listener
trace Session的产生和结束。

【在 l**d 的大作中提到】
: 哪用这么复杂?检查Session就是了。有的Session绑了用户(即login过),
: 则是login用户。没有绑定的,则是anonymous。

1 (共1页)
进入Java版参与讨论
相关主题
Eclipse不能保存UTF-8文件?问一个J2EE和Tomcat问题
can applet implements runnable?JSP+SERVLET网站一般用下面方式来保存和传递变量和参数
问一个特别土的问题session lost between JSP and Struts
Timer and TimerTask关于RIA
question: how to implement thisRe: JPanel help!
关于Jsp timeoutRe: 有没有办法在browser第一次访问的时候知道是不是支持cookie?
java servlet httpsession问题求教简单的EJB问题
How to access ActiveX control in JSP or EJB?Stateful session bean到底有啥好处?
相关话题的讨论汇总
话题: jsp话题: who话题: session话题: online话题: know