<?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>Generate Friendly URL through programatically Craeted URL</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118702433" />
  <subtitle>Generate Friendly URL through programatically Craeted URL</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118702433</id>
  <updated>2026-04-04T06:31:56Z</updated>
  <dc:date>2026-04-04T06:31:56Z</dc:date>
  <entry>
    <title>RE: Generate Friendly URL through programatically Craeted URL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118708020" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118708020</id>
    <updated>2020-03-10T14:04:25Z</updated>
    <published>2020-03-10T14:04:25Z</published>
    <summary type="html">Hi &lt;strong&gt;Dominik sir , &lt;br /&gt;&lt;/strong&gt;Thanks for valuable suggestion , I tried above approach but after above approach I am seeing mvcRenderCommandName also came in friendly URL &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://localiticourses.buildyourcareerpath.com:7080/welcome/-/UserProfile/ERZ4txCK76tp/PackageDetails?p_p_state=maximized&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_mvcRenderCommandName=%2Fuserprofileassociates%2Ffatch-perticuler-subcription-package&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_subscriptionPackageId=4&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_isPackageSubscribe=false"&gt;/-/UserProfile/ERZ4txCK76tp/PackageDetails?p_p_state=maximized&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_mvcRenderCommandName=%2Fuserprofileassociates%&lt;/a&gt;fetch&lt;a href="http://localiticourses.buildyourcareerpath.com:7080/welcome/-/UserProfile/ERZ4txCK76tp/PackageDetails?p_p_state=maximized&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_mvcRenderCommandName=%2Fuserprofileassociates%2Ffatch-perticuler-subcription-package&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_subscriptionPackageId=4&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_isPackageSubscribe=false"&gt;-&lt;/a&gt;package-detail&lt;a href="http://localiticourses.buildyourcareerpath.com:7080/welcome/-/UserProfile/ERZ4txCK76tp/PackageDetails?p_p_state=maximized&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_mvcRenderCommandName=%2Fuserprofileassociates%2Ffatch-perticuler-subcription-package&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_subscriptionPackageId=4&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_isPackageSubscribe=false"&gt;&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_subscriptionPackageId=4&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_isPackageSubscribe=false&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Do u have any other approach to make more less the URL to hidding parameters  ?&lt;br /&gt;&lt;br /&gt;Thanks &amp;amp; Regards, &lt;br /&gt;​​​​​​​Pradip</summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2020-03-10T14:04:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Generate Friendly URL through programatically Craeted URL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118707677" />
    <author>
      <name>Dominik Marks</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118707677</id>
    <updated>2020-03-10T13:54:05Z</updated>
    <published>2020-03-10T13:54:05Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I think you cannot "hide" those parameters, because the information needs to be somewhere.&lt;br&gt;&lt;br&gt;If you want to shorten the URL you could think of adding those parameters as part of the URL or define them as implicit parameters (e.g p_p_state=maximized) . For example like this:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp; &amp;amp;nbsp; &amp;lt;route&amp;gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;pattern&amp;gt;/{instanceId}/selectedPackageDetail/{subscriptionPackageId}/{isPackageSubscribe}&amp;lt;/pattern&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;ignored-parameter name="p_p_mode" /&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;ignored-parameter name="p_auth" /&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;ignored-parameter name="p_p_id" /&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;implicit-parameter name="p_p_lifecycle"&amp;gt;0&amp;lt;/implicit-parameter&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;implicit-parameter name="mvcRenderCommandName"&amp;gt;/userprofileassociates/fetch-package-detail&amp;lt;/implicit-parameter&amp;gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;lt;implicit-parameter name="p_p_state"&amp;gt;maximized&amp;lt;/implicit-parameter&amp;gt;
&amp;amp;nbsp;&amp;amp;nbsp; &amp;amp;nbsp;&amp;lt;/route&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Dominik Marks</dc:creator>
    <dc:date>2020-03-10T13:54:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: Generate Friendly URL through programatically Craeted URL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118706988" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118706988</id>
    <updated>2020-03-10T13:37:17Z</updated>
    <published>2020-03-10T13:37:17Z</published>
    <summary type="html">Hi everyone , &lt;br /&gt;I reached next step now , But here I am getting some issues &lt;br /&gt;&lt;br /&gt;&lt;a href="http://localiticourses.buildyourcareerpath.com:7080/welcome/-/UserProfile/ERZ4txCK76tp/selectedPackageDetail?p_p_state=maximized&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_subscriptionPackageId=4&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_isPackageSubscribe=false"&gt;http://locacourse:7080/welcome/-/&lt;strong&gt;UserProfile/ERZ4txCK76tp/selectedPackageDetail?p_p_state=maximized&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_subscriptionPackageId=4&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_isPackageSubscribe=false&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;How can I hide  Parameters  &lt;strong&gt;&lt;a href="http://localiticourses.buildyourcareerpath.com:7080/welcome/-/UserProfile/ERZ4txCK76tp/selectedPackageDetail?p_p_state=maximized&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_subscriptionPackageId=4&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_isPackageSubscribe=false"&gt;subscriptionPackageId&lt;/a&gt; , &lt;/strong&gt;&lt;strong&gt;&lt;a href="http://localiticourses.buildyourcareerpath.com:7080/welcome/-/UserProfile/ERZ4txCK76tp/selectedPackageDetail?p_p_state=maximized&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_subscriptionPackageId=4&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_isPackageSubscribe=false"&gt;isPackageSubscribe&lt;/a&gt; and &lt;/strong&gt;&lt;strong&gt;&lt;/strong&gt; &lt;strong&gt;&lt;a href="http://localiticourses.buildyourcareerpath.com:7080/welcome/-/UserProfile/ERZ4txCK76tp/selectedPackageDetail?p_p_state=maximized&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_subscriptionPackageId=4&amp;amp;_UserProfileAssociatesPortlet_INSTANCE_ERZ4txCK76tp_isPackageSubscribe=false"&gt;p_p_state&lt;/a&gt; &lt;/strong&gt;in URL ? &lt;br /&gt;we cannot go with &amp;lt;ignored-parameter&amp;gt;  because it removes from request object , I want to hide this parameters from URL only , because we are using this parameter values in Controller . &lt;br /&gt;below I am adding my route info. - &lt;ol style="list-style: decimal outside;" start="1"&gt;&lt;li&gt;&amp;lt;route&amp;gt;&lt;/li&gt;&lt;li&gt;        &amp;lt;pattern&amp;gt;/{instanceId}/selectedPackageDetail&amp;lt;/pattern&amp;gt;&lt;/li&gt;&lt;li&gt;        &amp;lt;ignored-parameter name=&amp;#34;p_p_mode&amp;#34; /&amp;gt;&lt;/li&gt;&lt;li&gt;        &amp;lt;ignored-parameter name=&amp;#34;p_auth&amp;#34; /&amp;gt;&lt;/li&gt;&lt;li&gt;        &amp;lt;ignored-parameter name=&amp;#34;p_p_id&amp;#34; /&amp;gt;&lt;/li&gt;&lt;li&gt;        &amp;lt;implicit-parameter name=&amp;#34;p_p_lifecycle&amp;#34;&amp;gt;0&amp;lt;/implicit-parameter&amp;gt;&lt;/li&gt;&lt;li&gt;        &amp;lt;implicit-parameter name=&amp;#34;mvcRenderCommandName&amp;#34;&amp;gt;/userprofileassociates/fetch-package-detail&amp;lt;/implicit-parameter&amp;gt;&lt;/li&gt;&lt;li&gt;    &amp;lt;/route&amp;gt;&lt;/li&gt;&lt;/ol&gt;</summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2020-03-10T13:37:17Z</dc:date>
  </entry>
  <entry>
    <title>Generate Friendly URL through programatically Craeted URL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118702432" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118702432</id>
    <updated>2020-03-10T04:41:16Z</updated>
    <published>2020-03-10T04:41:16Z</published>
    <summary type="html">Hi everyone , &lt;br /&gt;I am learning generating friendly URL , in that I am getting some problems like , If I create my url on tag based then I am getting correctly friendlyURL which I excepected , but If go with programatically URL then Liferay not generating friendly URL .. Anyone faced this issue ? &lt;br /&gt;&lt;br /&gt;&amp;lt;portlet:renderURL var=&amp;#34;testURL&amp;#34;&amp;gt;&lt;br /&gt;    &amp;lt;portlet:param name=&amp;#34;mvcRenderCommandName&amp;#34; value=&amp;#34;render/viewData&amp;#34;&amp;gt;&amp;lt;/portlet:param&amp;gt;&lt;br /&gt;    &amp;lt;portlet:param name=&amp;#34;userName&amp;#34; value=&amp;#34;John&amp;#34;&amp;gt;&amp;lt;/portlet:param&amp;gt;&lt;br /&gt;&amp;lt;/portlet:renderURL&amp;gt;&lt;br /&gt;&lt;br /&gt;In above case I am getting perfectlty friendly URL , But in below case same URL I am creating through Programmatically , then its not generating any friendly URL and I am getting that old large URL only . &lt;br /&gt;&lt;br /&gt;Layout testLayout = LayoutLocalServiceUtil.getFriendlyURLLayout(themeDisplay.getLayout().getGroup().getGroupId(), true, &amp;#34;/test-URL&amp;#34;);&lt;br /&gt;LiferayPortletURL testUrl = PortletURLFactoryUtil.create(request, &amp;#34;frienddemoclass&amp;#34;,testLayout.getPlid(), PortletRequest.RENDER_PHASE);&lt;br /&gt;testUrl .setParameter(&amp;#34;userName&amp;#34;, &amp;#34;John&amp;#34;);&lt;br /&gt;&lt;br /&gt;testUrl .setParameter(&amp;#34;mvcRenderCommandName&amp;#34;, &amp;#34;render/viewData&amp;#34;);&lt;br /&gt;anyone having idea , how can we generate friendlyURL when work with programatic URL ? </summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2020-03-10T04:41:16Z</dc:date>
  </entry>
</feed>
