Foren

RE: Always getting the same userId in template

thumbnail
Juhi Kumari, geändert vor 11 Jahren.

Always getting the same userId in template

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi,
I want the loged-in user id in my web content template. For this in template I use
#set($userId = $getterUtil.getLong($request.get("theme-display").get("user-id")))
or
#set ($uId = $getterUtil.getLong($request.remote-user))

But it always return user id of Test Test only . Don't know where I am missing??
If any idea please share!!!!

Regards
Juhi
thumbnail
Jitendra Rajput, geändert vor 11 Jahren.

RE: Always getting the same userId in template

Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
I guess UserId is default variable it should be directly available . No need to get it from request .
try to print $user_id
thumbnail
Juhi Kumari, geändert vor 11 Jahren.

RE: Always getting the same userId in template

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi Jitendra,

Thanks for your reply. But Its not working..emoticon

Regards
Juhi
thumbnail
Jitendra Rajput, geändert vor 11 Jahren.

RE: Always getting the same userId in template

Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
Did you tried by setting below property in portal-ext ?

journal.template.velocity.restricted.variables=
thumbnail
Juhi Kumari, geändert vor 11 Jahren.

RE: Always getting the same userId in template

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi,
Already I did that one, then only I am getting same userId always.

Regards
Juhi
thumbnail
James Falkner, geändert vor 11 Jahren.

RE: Always getting the same userId in template

Liferay Legend Beiträge: 1399 Beitrittsdatum: 17.09.10 Neueste Beiträge
Juhi Kumari:
Hi,
Already I did that one, then only I am getting same userId always.

Regards
Juhi


You need to uncheck the "Cacheable" option when editing the template.
thumbnail
Juhi Kumari, geändert vor 11 Jahren.

RE: Always getting the same userId in template

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi James,

Thanks for your reply. Now its working fine.

Regards
Juhi