How can I get the current user connected to a Liferay portal with a simple Java code?
I'm using Liferay 6.0.6
In case there's any confusion over the term, a User in Liferay is an entity that can sign into the portal and do something. Generally a User has more privileges, called Permissions, than a Guest of your site, who does not sign in.
Screen Name in Liferay is very important which is unique in the Portal. While creating user the Screen Name is mandatory field and Screen Name represents the actual user in the portal. Sometimes its necessary to validate the screen name entered by the user at the time of creation of users.
Simply:
User currentUser = PortalUtil.getUser(request);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With