如何在Spring-MVC中执行用户锁定? [英] How to perform user-locking in Spring-MVC?

查看:67
本文介绍了如何在Spring-MVC中执行用户锁定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何执行用户锁定(或执行相同操作的最佳方式),例如,如果用户已从设备登录并尝试从另一设备登录,则应通知他/她session已经可以供用户使用,并可以关闭其他会话并启动一个新的会话。

I wanted to know how I can perform user locking (or the best way to perform the same) i.e. if a user is already logged in from a device and tries to login from another device, he/she should be notified that a session is already available for that user and an option to close other session and start a new one.

使用的框架Spring-MVC + hibernate 4.1。

Framework Used Spring-MVC + hibernate 4.1.

还有一件事:如何在应用程序上下文中设置一些用户hashmap对象的列表?

And one more thing: how can I set a list of some user hashmap object in application context?

推荐答案

这可以通过Spring Security和连续会话控制。您可以定义同时存在多少个会话,并决定如果最大值超过,应该怎么做。

That can be done with Spring Security and Conncurrent Session Control. You can define how many sessions may exist concurrently and decide what to do if the maximum exceeds.

这篇关于如何在Spring-MVC中执行用户锁定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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