Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

User List in Container Managed Security  RSS feed

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Container Managed Security and want to list/count the number of users authenticated so far. What would be the best strategy to do this? The problem is that the spec defines authenticated user as having non-null value in request.getUserPrincipal(). How could I count the number of Principal objects maintained by the container?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the container doesn't allow a mechanism to exatract this information, you can look at ways to 'decorate' the login/logout process to maintain your own count. You can also add session listeners to track 'visitors' by finding sessions that do not have credentials attached.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!