Foros de discusión
Get UserId of logged in user without request object
Hussain Shaikh, modificado hace 11 años.
Get UserId of logged in user without request object
Junior Member Mensajes: 44 Fecha de incorporación: 7/06/12 Mensajes recientes
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 hace 11 años.
RE: Get UserId of logged in user without request object
Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
You can always access PrincipalThreadLocal just remember that any scheduled tasks won't have any user associated with them.
Rahul Sharma, modificado hace 11 años.
RE: Get UserId of logged in user without request object
Junior Member Mensajes: 59 Fecha de incorporación: 11/01/12 Mensajes recientes
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 hace 11 años.
RE: Get UserId of logged in user without request object
Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
Rahul, usually when you don't have request you don't have ThemeDisplay either.