@RequestMapping(value = "/listActiveUsers", method = RequestMethod.GET)
    public String listActiveUsers(Model model) {
        Map<Object, Date> lastActivityDates = new HashMap<Object, Date>();
        for (Object principal : sessionRegistry.getAllPrincipals()) {
            // a principal may have multiple active sessions
            for (SessionInformation session : sessionRegistry.getAllSessions(principal, false)) {
                // no last activity stored
                if (lastActivityDates.get(principal) == null) {
                    lastActivityDates.put(principal, session.getLastRequest());
                } else {
                    // check to see if this session is newer than the last stored
                    Date prevLastRequest = lastActivityDates.get(principal);
                    if (session.getLastRequest().after(prevLastRequest)) {
                        // update if so
                        lastActivityDates.put(principal, session.getLastRequest());
                    }
                }
            }
        }

        model.addAttribute("activeUsers", lastActivityDates);
        
        int amountOfUsers = sessionRegistry.getAllPrincipals().size();
        model.addAttribute("numUsers", amountOfUsers);
        
        return ".listActiveUsers";
    }