title: How to convert a portal URL to its corresponding friendly URL
body: <p>I have implemented friendly-url successfully for few of my custom portlets and it is working fine.</p>
  
  <p>When click-able links are generated, it correctly shows the friendly-url.</p>
  
  <p>Now my requirement is that, I need to send this render-URL (say <code>URL01</code>) as a parameter (<code>param02</code>) to another URL (<code>URL02</code>) and this <code>URL01</code> then would be displayed on another page.</p>
  
  <p>This is how <code>URL01</code> is generated:</p>
  
  <pre><code>&lt;portlet:renderURL var="URL01" windowState="&lt;%=WindowState.MAXIMIZED.toString() %&gt;"&gt;
      &lt;portlet:param name="redirect" value="&lt;%= currentURL %&gt;" /&gt;
      &lt;portlet:param name="myId" value="&lt;%= String.valueOf(myObject.getMyId()) %&gt;" /&gt;
      &lt;portlet:param name="title" value="&lt;%= myObject.getTitle() %&gt;" /&gt;
      &lt;portlet:param name="name" value="&lt;%= myObject.getName() %&gt;" /&gt;
  &lt;/portlet:renderURL&gt;
  </code></pre>
  
  <p>This is how <code>URL02</code> is generated</p>
  
  <pre><code>&lt;portlet:renderURL var="URL02" windowState="&lt;%= LiferayWindowState.POP_UP.toString() %&gt;"&gt;
      &lt;portlet:param name="redirect" value="&lt;%= currentURL %&gt;" /&gt;
      &lt;portlet:param name="URL01" value="&lt;%=URL01 %&gt;" /&gt;
      &lt;portlet:param name="ownerId" value="&lt;%= String.valueOf(ownerId) %&gt;" /&gt;
      &lt;portlet:param name="groupId" value="&lt;%= String.valueOf(scopeGroupId) %&gt;" /&gt;
  &lt;/portlet:renderURL&gt;
  </code></pre>
  
  <p>This <code>URL02</code> would open a pop-up and the <code>URL01</code> would be displayed as below in the JSP:</p>
  
  <pre><code>URL: &lt;%= ParamUtil.getString(request, "URL01") %&gt;
  </code></pre>
  
  <p>But this shows <code>URL01</code> (unfriendly-URL) as:</p>
  
  <pre><code>URL: http://localhost:8080/web/guest/mypage?p_p_id=my_WAR_myportlet&amp;p_p_lifecycle=0&amp;p_p_state=maximized&amp;p_p_mode=view&amp;_my_WAR_myportlet_myId=10989&amp;_my_WAR_myportlet_title=This+is+miine&amp;my_WAR_myportlet_name=What+name
  </code></pre>
  
  <p>If this is a clickable link it generates perfectly as (friendly-URL):</p>
  
  <pre><code>&lt;a href="http://localhost:8080/web/guest/mypage/-/mine/10989/This+is+miine/What+name/maximized"&gt; Click me! &lt;/a&gt;
  </code></pre>
  
  <p>So I need a utility which can convert my unfriendly-url to friendly-URL, something like if a <code>String</code> of unfriendly-url is passed - it would convert that to the friendly-url shown above.</p>
  
  <p>Or I have to create an implementation of my own to achieve this?</p>
  
  <p><strong>Edit:</strong></p>
  
  <pre><code>&lt;route&gt;
      &lt;pattern&gt;/{myId:\d+}/{title:.+}/{name:.+}/{p_p_state}&lt;/pattern&gt;        
      &lt;ignored-parameter name="redirect" /&gt; 
      &lt;implicit-parameter name="p_p_id"&gt;my_WAR_myportlet&lt;/implicit-parameter&gt;
      &lt;implicit-parameter name="p_p_lifecycle"&gt;0&lt;/implicit-parameter&gt;
      &lt;implicit-parameter name="p_p_mode"&gt;view&lt;/implicit-parameter&gt;
  &lt;/route&gt;
  </code></pre>
  
  <p>And yes the <code>URL01</code> is written above the <code>URL02</code> in the JSP.</p>