This content has been marked as final.
Show 2 replies
-
1. Re: Retrieving username in portlet after login
webhunter Aug 13, 2007 6:24 AM (in response to webhunter)ok found it.
you can use the getUserPrincipal() method on the PortletRequest object.
If you are wondering where is the PortletRequest object, the "rRequest" object in protected void doView(RenderRequest rRequest, RenderResponse rResponse) is the PortletRequest object.
To get the actual user name you could use:
rRequest.getUserPrincipal().getName()
Cheers. -
2. Re: Retrieving username in portlet after login
cerberus310 Aug 13, 2007 6:26 AM (in response to webhunter)RenderRequest.getRemoteUser() will provide you with the string representation of the user. I recommend consulting the API JDoc for more info.