<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Unable to get the logged user screen name in velocity template - DXP?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111941556" />
  <subtitle>Unable to get the logged user screen name in velocity template - DXP?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=111941556</id>
  <updated>2026-04-04T04:59:12Z</updated>
  <dc:date>2026-04-04T04:59:12Z</dc:date>
  <entry>
    <title>RE: Unable to get the logged user screen name in velocity template - DXP?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111957416" />
    <author>
      <name>Chanakya P</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111957416</id>
    <updated>2023-01-24T06:25:47Z</updated>
    <published>2019-01-08T11:08:15Z</published>
    <summary type="html">&lt;p&gt;Thanks for your solution.&lt;/p&gt;
&lt;p&gt;It is working now &lt;img alt="yes" height="23"
    src="https://community.liferay.com/o/frontend-editor-ckeditor-web/ckeditor/plugins/smiley/images/thumbs_up.png"
    title="yes" width="23" /&gt;&lt;/p&gt;</summary>
    <dc:creator>Chanakya P</dc:creator>
    <dc:date>2019-01-08T11:08:15Z</dc:date>
  </entry>
  <entry>
    <title>RE: Unable to get the logged user screen name in velocity template - DXP?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111955978" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111955978</id>
    <updated>2019-01-08T08:45:55Z</updated>
    <published>2019-01-08T08:45:55Z</published>
    <summary type="html">&lt;blockquote&gt;
  &lt;div class="quote-content"&gt;Chanakya P: &lt;p&gt;
      &lt;strong&gt;Template Code:&lt;/strong&gt;&lt;/p&gt;
    &lt;p&gt;
      &lt;strong&gt;#set( $user = $permissionChecker.getUser()) &lt;br /&gt; Screen
        Name: $user.screenName&amp;lt;br&amp;gt; &lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;In the template editor, under &amp;quot;Details&amp;quot;, there's a
  &amp;quot;Cachable&amp;quot; checkbox, checked by default. The help text reads:&lt;/p&gt;
&lt;p&gt;
  &lt;cite&gt;Only uncheck when developing templates which use request
    handling, CMS query API, or other dynamic features.&lt;/cite&gt;&lt;/p&gt;
&lt;p&gt;Uncheck this, because you're using dynamic features. Otherwise it
  will always show the (cached) value from its first execution.&lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2019-01-08T08:45:55Z</dc:date>
  </entry>
  <entry>
    <title>RE: Unable to get the logged user screen name in velocity template - DXP?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111954046" />
    <author>
      <name>Chanakya P</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111954046</id>
    <updated>2023-01-24T06:25:47Z</updated>
    <published>2019-01-08T06:42:26Z</published>
    <summary type="html">&lt;p&gt;Thank you for reply.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;
  &lt;strong&gt;Version:&lt;/strong&gt; liferay-dxp-digital-enterprise-7.0-sp6&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;
  &lt;strong&gt;Structure:&lt;/strong&gt; just have one text field and am not used
  this text filed in template.&lt;/p&gt;
&lt;p&gt;
  &lt;strong&gt;Template Code:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;strong&gt;#set( $user = $permissionChecker.getUser()) &lt;br /&gt; Screen
    Name: $user.screenName&amp;lt;br&amp;gt; &lt;/strong&gt;&lt;/p&gt;</summary>
    <dc:creator>Chanakya P</dc:creator>
    <dc:date>2019-01-08T06:42:26Z</dc:date>
  </entry>
  <entry>
    <title>RE: Unable to get the logged user screen name in velocity template - DXP?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111945596" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111945596</id>
    <updated>2019-01-07T15:32:04Z</updated>
    <published>2019-01-07T15:32:04Z</published>
    <summary type="html">&lt;p&gt;First, shame on your for continuing to use Velocity instead of
  Freemarker. Now that we have that out of the way :) ...&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;1. What if you use another mechanism to get the user? for example, if
  you use the staticUtil to load the PortalUtil class and get the user
  from the Request -- does it still give you the same result?&lt;/p&gt;
&lt;p&gt;2. Can you share your velocity template with me. I will (reluctantly)
  add it to a local DXP on my side and try it, if #1 doesn't give you a
  better result.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;(Can you also share the exact version SP/FP you are running)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2019-01-07T15:32:04Z</dc:date>
  </entry>
  <entry>
    <title>Unable to get the logged user screen name in velocity template - DXP?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111941555" />
    <author>
      <name>Chanakya P</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=111941555</id>
    <updated>2023-01-24T06:25:47Z</updated>
    <published>2019-01-07T12:49:17Z</published>
    <summary type="html">&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;I used below code in velocity template (Structures and Template) to
  get the logged user screenName&lt;br /&gt;    &lt;strong&gt; #set( $user =
    $permissionChecker.getUser()) &lt;br /&gt;     Screen Name: $user.screenName&amp;lt;br&amp;gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Above code always giving test user related screenName eventhough
  logged with other user.&lt;/p&gt;
&lt;p&gt;
  &lt;strong&gt;Actuall Result:&lt;/strong&gt;
  &lt;br /&gt;     Always showing test user screen name eventhough logged with
  other user.&lt;/p&gt;
&lt;p&gt;
  &lt;br /&gt;
  &lt;strong&gt;Expected Result:&lt;/strong&gt;
  &lt;br /&gt;     It should show the user screen name who is logged in to the
  portal.&lt;br /&gt;     &lt;br /&gt; Can any help me out.&lt;/p&gt;</summary>
    <dc:creator>Chanakya P</dc:creator>
    <dc:date>2019-01-07T12:49:17Z</dc:date>
  </entry>
</feed>
