title: How do I get Liferay's Javascript PortletURL module to work with friendly URL mappings?
body: <p>I've set up friendly URL routing for my Liferay portlet, and it's working fine when I generate URLs with the standard JSP tags like so:</p>
  
  <pre><code>&lt;portlet:renderURL var="resetUrl"&gt;
      &lt;portlet:param name="start" value="5" /&gt;
  &lt;/portlet:renderURL&gt;
  </code></pre>
  
  <p>which, given my mapping, produces a lovely URL like:</p>
  
  <pre><code>localhost:8080/web/guest/welcome/-/myportlet/5
  </code></pre>
  
  <p>But when I generate URLs using the JavaScript <strong>PortletURL</strong> module, I get the full unfriendly URL. For instance:</p>
  
  <pre><code>var filterUrl = Liferay.PortletURL.createRenderURL();
  filterUrl.setPortletId("&lt;%= portletDisplay.getId() %&gt;");
  filterUrl.setParameter("start", "5");
  location.href = filterUrl;
  </code></pre>
  
  <p>will generate</p>
  
  <pre><code>localhost:8080/web/guest/welcome?p_p_id=myportlet_WAR_MyPortletportlet&amp;p_p_lifecycle=0&amp;myportlet_WAR_MyPortletportlet_start=5
  </code></pre>
  
  <p>So my question is:
  <strong>How can I generate friendly URLs from JavaScript?</strong></p>