English 中文(简体)
JSF 伐木 同时有两个用户
原标题:JSF Login Two users at the same time

Im working in a Web App with Java and JSF. I have a simple login, if it finds the user in the database it creates a session and stores some information on it. That works great. The thing is, I want to avoid two different people using the same user name and password at the same time. Something like account sharing. Only one user logged at one time. I have been thinking this but I can t find the correct approach.

事先感谢你们的所有帮助。

最佳回答

我认为,一种方式是将一个 b形田地(<>条码>挂号_in输入数据库,一旦某人在某一日志或某届会议到期时,即予以确认。 使人很容易去做时,便会弄错。 本届会议的会期已经结束,我相信会利用共同财产基金,在用户登录后,有一份会议复印机管理有关用户的信息。 您可以采用@Prestroy 方法,用于管理豆类,并请其将田地划为假地,然后在会议过期时予以删除。

当有人通过标识小组向服务器发送“用户名称”和“密码”时,你才需要检查<代码>是否贴上<<>条/代码>。 外地是真实的。

问题回答

你们可以建立一个应用范围广的灯,以便跟踪目前用户对网络应用的标识。 如果一个信标在适用范围内,所有客户的所有申请/答复周期都将使用相同的信标。

您可在此申请中宣布,以便储存目前所有日志用户信息。 当用户登录时,检查用户信息数据库是否位于。 如果是的话,这意味着他已经 log。 否则,就意味着他尚未登记。

每当用户成功登录时,将其用户信息输入HashSet。 每当用户登录时,便将其用户信息从<代码>HashSet上删除。 用户会议过期使用<代码> HttpSessionListener 或@Destroy,以记录这一活动,并从上删除相应的用户信息。

关于如何利用本届会议结束的活动,请参阅。 页: 1

For how to force an application-scoped bean to instantiate when the webapps starts , you can refer to this





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签