如何使用jsp,servlet列出Web应用程序中所有已登录的用户 [英] how to list out all the logged on users in a web application using jsp,servlets

查看:104
本文介绍了如何使用jsp,servlet列出Web应用程序中所有已登录的用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要列出所有已登录的用户信息(用户名),并且必须在gmail或orkut中显示类似在线朋友列表的列表.我正在使用JSP和Servlet.谁能在这方面帮助我.

I need to list out all the logged on users information(username) and i have to show the list like online friends list in gmail or orkut. I am using JSP and Servlets. can anybody help me in this regard.

谢谢.

推荐答案

您需要维护服务器端会话.例如,您可以维护一个HashMap.因此,当那时有任何新用户登录时,您需要在该Map中进行输入.而且,只要您需要所有已登录用户的信息,就可以轻松获取.

You need to maintain a server side session. For example, you can maintain a HashMap. So, when any new user logged in at that time you need to do entry in that Map. And whenever you need all logged in user's information, you can get it easily.

这篇关于如何使用jsp,servlet列出Web应用程序中所有已登录的用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆