是否有可能获得所有活动会话的列表? [英] Is it possible to get a List of all active Sessions?
本文介绍了是否有可能获得所有活动会话的列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Grails动作中,我可以使用 session 访问HTTPSession。
是否也可以获取所有活动列表你可以使用 getSessionsInfo()
方法来获得<$>
首先安装插件(在BuildConfig中)
compile:app -info:1.0.2{
不包括'jquery'
}
然后在配置文件中输入
grails.plugins.appinfo.useContextListener = true
终于注入服务并使用它的 getSessionsInfo()
方法
def scopesInfoService
...
scopesInfoService.getSessionsInfo()
以获取所有活动会话的列表。
When being in a Grails action I can access a HTTPSession with session.
Is it also possible to get a list of all active sessions?
解决方案
You can use getSessionsInfo()
method of ScopesInfoService
service of Application Info plugin.
First install plugin(in BuildConfig)
compile ":app-info:1.0.2"{
excludes 'jquery'
}
then make an entry in Config
grails.plugins.appinfo.useContextListener = true
finally inject service and use its getSessionsInfo()
method
def scopesInfoService
...
scopesInfoService.getSessionsInfo()
to get the list of all active sessions.
这篇关于是否有可能获得所有活动会话的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文