Foren
Friendly URL problem
Milan Kostoláni, geändert vor 11 Jahren.
Friendly URL problem
Junior Member Beiträge: 92 Beitrittsdatum: 26.07.12 Neueste Beiträge
Hello everyone
Im having a problem to complete friendly URLs
the link looks like this
I tried this:
also tried with {value:\d+}
However then it didnt work at all
Is there any solution for this?
Im having a problem to complete friendly URLs
the link looks like this
...?_myportlet_WAR_myportlet_[u]value=10.0[/u]
I tried this:
<route>
<pattern>/view/{value}</pattern>
<ignored-parameter name="p_p_id" />
<implicit-parameter name="p_p_lifecycle">1</implicit-parameter>
<implicit-parameter name="javax.portlet.action">someAction</implicit-parameter>
</route>
also tried with {value:\d+}
However then it didnt work at all
Is there any solution for this?
Shashant Panwar, geändert vor 11 Jahren.
RE: Friendly URL problem
Junior Member Beiträge: 28 Beitrittsdatum: 21.09.12 Neueste Beiträge
Hi Milan,
Create a url-mapping.xml file in your resources.
Add the below entry in the file:
<?xml version="1.0"?>
<!DOCTYPE routes PUBLIC "-//Liferay//DTD Friendly URL Routes 6.1.0//EN" "http://www.liferay.com/dtd/liferay-friendly-url-routes_6_1_0.dtd">
<routes>
<route>
<pattern>/{value}</pattern> ----- try without "/view/"
<implicit-parameter name="p_p_resource_id">your resource name</implicit-parameter>
<implicit-parameter name="p_p_lifecycle">2</implicit-parameter>
<implicit-parameter name="p_p_cacheability">cacheLevelPage</implicit-parameter>
</route>
</routes>
Also,you need to add the below piece of code in your liferay-portlet.xml.
<portlet>
.....after icon
<friendly-url-mapper-class>com.liferay.portal.kernel.portlet.DefaultFriendlyURLMapper</friendly-url-mapper-class>
<friendly-url-mapping>your resource name which will map your url</friendly-url-mapping>
<friendly-url-routes>/urlMapping/you url-mapping.xml name</friendly-url-routes>
....
</portlet>
In my case,I created a resource,basically a hyperlink on which a new page with a friendly url.
I hope this will help.Good luck
Create a url-mapping.xml file in your resources.
Add the below entry in the file:
<?xml version="1.0"?>
<!DOCTYPE routes PUBLIC "-//Liferay//DTD Friendly URL Routes 6.1.0//EN" "http://www.liferay.com/dtd/liferay-friendly-url-routes_6_1_0.dtd">
<routes>
<route>
<pattern>/{value}</pattern> ----- try without "/view/"
<implicit-parameter name="p_p_resource_id">your resource name</implicit-parameter>
<implicit-parameter name="p_p_lifecycle">2</implicit-parameter>
<implicit-parameter name="p_p_cacheability">cacheLevelPage</implicit-parameter>
</route>
</routes>
Also,you need to add the below piece of code in your liferay-portlet.xml.
<portlet>
.....after icon
<friendly-url-mapper-class>com.liferay.portal.kernel.portlet.DefaultFriendlyURLMapper</friendly-url-mapper-class>
<friendly-url-mapping>your resource name which will map your url</friendly-url-mapping>
<friendly-url-routes>/urlMapping/you url-mapping.xml name</friendly-url-routes>
....
</portlet>
In my case,I created a resource,basically a hyperlink on which a new page with a friendly url.
I hope this will help.Good luck