简体   繁体   English

Liferay:显示访客人数

[英]Liferay: Display the visitor's count

I trying to show the visitor's count on home page by creating on portlet for it.Here i am trying to use the session concept. 我试图通过在portlet上创建访问者的数量来显示主页的计数。在这里,我尝试使用会话概念。 After session expiration ,if the user relogin then the count should increases. 会话期满后,如果用户重新登录,则计数应增加。

Q1: Can any one tell me how i can get the session id on the portlet because as per my knowledge we cannot cross the servlet session boundary. Q1:谁能告诉我如何在Portlet上获取会话ID,因为据我所知,我们无法跨越Servlet会话边界。 The login pre action is going to run within the ROOT servlet session and the portlet, deployed as a separate WAR file, has a separate servlet session. 登录前操作将在ROOT servlet会话中运行,并且作为单独WAR文件部署的portlet具有单独的servlet会话。

Q2: Also are these session id are unique each time they created? 问题2:这些会话ID每次创建时都是唯一的吗?

Also please guide me how i can do this ? 还请指导我如何做到这一点? Also share some doc ref for more understanding... 还分享一些文档参考以进一步了解...

LiveUsers.getSessionUsers(company.getCompanyId())

This should allow you to retrieve user sessions for connected users. 这应该允许您检索已连接用户的用户会话。 Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM