How can I get the current user in Liferay?

med  picture med · May 9, 2012 · Viewed 35k times · Source

How can I get the current user connected to a Liferay portal with a simple Java code?

I'm using Liferay 6.0.6

Answer

Mark picture Mark · May 10, 2012

Simply:

User currentUser = PortalUtil.getUser(request);