Spring Security中的最大并发用户数 [英] Maximum concurrent users in Spring Security

查看:571
本文介绍了Spring Security中的最大并发用户数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用Spring Security 3.0,并且我限制用户最多只能有一个会话.配置如下:

I am using Spring Security 3.0 in my project and I am restricting user to have maximum one session. Configuration is given below :

<security:session-management>
            <security:concurrency-control error-if-maximum-exceeded="true" max-sessions="1"/>
</security:session-management>

我要在达到最大会话数时打印自定义消息(春季未默认提供).请帮忙.

I want to print the custom message(not default provided by spring) when maximum sessions are reached. Please help.

提前谢谢!

推荐答案

请将其保存在您的messages.properties

ConcurrentSessionControlStrategy.exceededAllowed=This account is already using by someone.

它将显示此帐户已被某人使用".你可以随心所欲.

it will display "This account is already using by someone." you can give what ever you want.

也不要忘记配置Resourcebundle

这篇关于Spring Security中的最大并发用户数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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