How to get the current logged in user's username anywhere in the session?
I've a very basic problem with Spring Security.
I've implemented Spring Security 3 and have a login form which is working fine.
But once inside I need to fetch data from the Database which is related to the current logged-in user.
So how can I get the username of the current user?
I've tried request.getRemoteUser() on the first request, but will it work on every request. I really doubt that.
Please guide me. HELP. Any help is really appreciated.