To limit the number of accounts can only be landed in one place, that is, the back of the landing will force the front landing of the person to exit, the front of the people to squeeze offline function
The idea is simply to save a currenthashmap<string,long> on the server side Logininfo
The key to this map is a string that uniquely identifies an account, such as ID, and so on, and value is the login time of the account.
An attribute is stored in the session of the logged in account, and the value of this property is the time of the login.
Then configure a filter in Web. XML, each request to determine the login time in the session of the account and the server memory in the account of the login time comparison, if the session in the logon time is less than the server in the memory of the login time, then the logon time is relatively early, forcing it to exit.
The specific code implementation is very simple, the idea is the most important