我正在使用 spring security 2。
1.我可以知道如何使用 securitycontextholder 来获取活跃用户总数吗?
2. 可以从securitycontextholder中获取sessionregistry吗?
最佳答案
扩展AuthenticationProcessingFilter
覆盖
@Override
protected void onSuccessfulAuthentication(HttpServletRequest request,
HttpServletResponse response, Authentication authResult)
throws IOException {
在这里您可以通过保留一个应用程序变量来做您想做的事情。
关于java - 计算活跃用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3818702/