struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Omar Ngarigari <ngarigar...@yahoo.com>
Subject Re: How to pass the current logged in username to struts2 action from spring security 3
Date Fri, 01 Mar 2013 11:57:46 GMT
Thanks Luksz for replying, but what i want is to use the username in Struts 2 action class
and display in struts2 jsp tags

Sent from my iPhone

On Mar 1, 2013, at 1:09 AM, Lukasz Lenart <lukaszlenart@apache.org> wrote:

> 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
> 

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


Mime
View raw message