I have two java classes, the first is a Servlet that register users access to the same servlet, the second class implements a ServletContextListener and update the HashMap removing the expired access.I need this Application to obtain a list of online users on an android app, so if you know an easiest way please tell me.
this is the code:
at the moment the application doesn't work fine, because the update doens't happen and after few minutes a ConcurrentModificationException occurs...
posted 4 years ago
I fixed the issue about ConcurrentModificationException changing HashMap with ConcurrentHashMap but now when the ServletContextListener remove some keys from the map, when I print this map from the servlet, it prints all the keys, also the removed keys. Why?
EDIT: I fixed also the latest issue
I child proofed my house but they still get in. Distract them with this tiny ad:
how do I do my own kindle-like thing - without amazon