Find number of active sessions created from a given client IP
问题 Is there a way to determine the number of active sessions created from a given client IP address? 回答1: The standard Servlet API doesn't offer facilities for that. Best what you can do is to maintain a Map<HttpSession, String> yourself (where the String is the IP address) with and check on every ServletRequest if the HttpSession#isNew() and add it to the Map along with ServletRequest#getRemoteAddr(). Then you can get the amount of IP addresses with an active session using Collections#frequency