Howdy folks,
I am trying to prevent multiple logins per user. I have done that
and it works fine, but the code does not take into account synchronization
of the code that adds and removes the username for each session.
I am hoping for some help with this part. Also, if you notice anything that
could improve the performance of the code, suggestions would be appreciated.
Here is a link to the four classes that are involved.
Code example There is:
1. MultipleLoginServlet that creates the HashMap upon starting the web container.
2. LoginHashMap that adds and removes the username value with the session ID as the key.
3. LoginServlet that adds the username to the LoginHashMap object when the user logs in.
4. LoginSessionListener that removes the username from the LoginHashMap when the session ends.
Thanks,
Howard