title: Access portlet namespace in Freemarker template
body: <p>I'm using a freemarker template to display web contents listed in an asset publisher.</p>
  
  <p>In the template I'm trying to assign the portlet-namespace in order to use some asset features (like printing the entry) like this</p>
  
  <pre><code>&lt;#attempt&gt;
    &lt;#assign namespace = request["portlet-namespace"]&gt;
    &lt;#recover&gt;
    &lt;#assign namespace = 'undefined'&gt;
  &lt;/#attempt&gt;
  </code></pre>
  
  <p>So, the print button is holding te code below</p>
  
  <pre><code>&lt;a href="javascript:${namespace}printPage_0();" title='Print'&gt;
  </code></pre>
  
  <p><code>printPage</code> is the method used in liferay asset publisher code in <code>asset_print.jspf</code></p>
  
  <p>Well, everything is working fine: when inspecting the page in a browser, I verified that the namespace has been calculated and assigned to namespace variable as well (and no error displayed in UI). However, liferay portal logs the following each time a user tries to see the whole web content (ie. clicks on read more) from the asset publisher</p>
  
  <pre><code>Expression request["portlet-namespace"] is undefined on line
  </code></pre>
  
  <p>Anyone has seen this problem ? Is there another way to get the portlet-namespace in a freemarker template ?</p>