struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: How to pass the current logged in username to struts2 action from spring security 3
Date Fri, 01 Mar 2013 06:09:39 GMT
2013/3/1 Omar Ngarigari <ngarigarius@yahoo.com>:
> Hello,
>
> Thanks in advance. I have an application that uses Spring Security 3 + Struts2. The integration
works just fine. I can login without an issue. However, I would like to get the username in
the Struts2 action class so that I can display in the Struts2 tags jsp pages.

UserDetails userDetails =
 (UserDetails)SecurityContextHolder.getContext().getAuthentication().getPrincipal();

http://stackoverflow.com/questions/6161985/get-userdetails-object-from-security-context-in-spring-mvc-controller


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message