Reputation: 21
I'm running Tomcat 6 and have implemented JDBCRealm to authenticate my users. I've got everything setup and authentication is working just fine.
My question is: how do I programmatically get the username of the user who is logged-in? Is this a session attribute that gets set? A Cookie?
This seems very trivial but I'm stumped. Any help is greatly appreciated. Thanks!!
Upvotes: 2
Views: 1761
Reputation: 7779
You can try getting this information from HttpServletRequest
using getUserPrincipal()
call.
Upvotes: 2