Fórum
Get UserId of logged in user without request object
Hussain Shaikh, modificado 11 Anos atrás.
Get UserId of logged in user without request object
Junior Member Postagens: 44 Data de Entrada: 07/06/12 Postagens Recentes
Hi,
How can i get current user's userId without a request object?
Thanks
How can i get current user's userId without a request object?
Thanks
Mika Koivisto, modificado 11 Anos atrás.
RE: Get UserId of logged in user without request object
Liferay Legend Postagens: 1519 Data de Entrada: 07/08/06 Postagens Recentes
You can always access PrincipalThreadLocal just remember that any scheduled tasks won't have any user associated with them.
Rahul Sharma, modificado 11 Anos atrás.
RE: Get UserId of logged in user without request object
Junior Member Postagens: 59 Data de Entrada: 11/01/12 Postagens Recentes
Hi Hussain,
You can use ThemeDisplay object to get the user's userID, such as themeDisplay.getUserId().
Hope this will help you.
Regards,
Rahul
You can use ThemeDisplay object to get the user's userID, such as themeDisplay.getUserId().
Hope this will help you.
Regards,
Rahul
Mika Koivisto, modificado 11 Anos atrás.
RE: Get UserId of logged in user without request object
Liferay Legend Postagens: 1519 Data de Entrada: 07/08/06 Postagens Recentes
Rahul, usually when you don't have request you don't have ThemeDisplay either.