Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Ravi Kiran
Liferay 6: Can the Liferay Friendly URL can be modified in my case
April 15, 2012 11:13 AM
Answer

Ravi Kiran

Rank: Junior Member

Posts: 53

Join Date: April 7, 2012

Recent Posts

Hi ,

I am using liferay 6.1

I have added this inside the liferay-portet.xml file

<friendly-url-mapper-class>com.liferay.portal.kernel.portlet.DefaultFriendlyURLMapper</friendly-url-mapper-class>
<friendly-url-mapping>Gasd</friendly-url-mapping>
<friendly-url-routes>com/test/friendlier-friendly-url-routes.xml</friendly-url-routes>


And as per the COntext root (Or the Portlet name ) this is my friendlier-friendly-url-routes.xml


<routes>
<route>
<pattern>/satportlet</pattern>
</route>
</routes>



But still the URL of that Portlet looks this way when i did a Submit Operation


http://localhost:8086/web/guest/home/-/Gasd/satportlet?p_auth=EFAy7VSA&p_p_lifecycle=1&_satportlet_WAR_SatPractportlet_javax.portlet.action=addBook


Is there anyway that this can be improved .

I am very much new to Liferay , please suggest me , i am ready to do chnages as you mention .
Bart Simpson
RE: Liferay 6: Can the Liferay Friendly URL can be modified in my case
April 15, 2012 11:14 PM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

You specified the patter as
1<pattern>/satportlet</pattern>

this means that liferay will map the the parameters which you specify along with this patter, which seems to be missing here.
So liferay will replace / add parameter values when it finds a url starting with
1http://localhost:8086/web/guest/home/-/Gasd/satportlet

for example you can specify the <implicit-parameter name="p_p_lifecycle">2</implicit-parameter>
so this won't appear in the url and they will appear more friendly

Go through this link: http://www.liferay.com/community/wiki/-/wiki/Main/FriendlyURLMapper
It will be very helpful, and post you question in case you can't figure out something

Hope it helps

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!