Foren
Specify javax.portlet.action in friendly URL mapping routes.xml file?
Phoenix Zerin, geändert vor 12 Jahren.
Specify javax.portlet.action in friendly URL mapping routes.xml file?
Junior Member Beiträge: 60 Beitrittsdatum: 28.06.11 Neueste Beiträge
For my MVC plugin portlet, I have the following route defined in my friendly URL mapping file:
Liferay *does* generate the URL correctly when I add the following code to my portlet's JSPs:
The above evaluates to http://.../-/photolibrary/detail/12301/?p_auth=ud04ptaE&...
But when I go to the generated URL, it does not use the correct action (it executes the portlet's doView() method instead).
What do I need to do to fix this?
<!--?xml version="1.0"?-->
<routes>
<route>
<pattern>/detail/{image:\d+}/from/{referrer}</pattern>
<implicit-parameter name="javax.portlet.action">doViewDetail</implicit-parameter>
</route>
</routes>
Liferay *does* generate the URL correctly when I add the following code to my portlet's JSPs:
<portlet:actionurl name="doViewDetail" var="detailURL">
<portlet:param name="image" value="<%= Long.toString(image.getImageId()) %>" />
</portlet:actionurl>
The above evaluates to http://.../-/photolibrary/detail/12301/?p_auth=ud04ptaE&...
But when I go to the generated URL, it does not use the correct action (it executes the portlet's doView() method instead).
What do I need to do to fix this?
Phoenix Zerin, geändert vor 12 Jahren.
RE: Specify javax.portlet.action in friendly URL mapping routes.xml file? (Antwort)
Junior Member Beiträge: 60 Beitrittsdatum: 28.06.11 Neueste Beiträge
Figured it out. I needed to add the following:
My routes.xml file now looks like this:
<implicit-parameter name="p_p_lifecycle">1</implicit-parameter>
My routes.xml file now looks like this:
<!--?xml version="1.0"?-->
<routes>
<route>
<pattern>/detail/{image:\d+}/from/{referrer}</pattern>
<implicit-parameter name="p_p_lifecycle">1</implicit-parameter>
<implicit-parameter name="javax.portlet.action">doViewDetail</implicit-parameter>
</route>
</routes>
Stian Sigvartsen, geändert vor 10 Jahren.
RE: Specify javax.portlet.action in friendly URL mapping routes.xml file?
Regular Member Beiträge: 103 Beitrittsdatum: 27.08.10 Neueste Beiträge
Do you/anyone know if this works with Liferay 6.1? I've got a very similar URL route, but when requesting the URL manually it is responding with "forbidden" and "You do not have permission to access the requested resource" page content rendered.
-Stian
-Stian
Jack Bakker, geändert vor 7 Jahren.
RE: Specify javax.portlet.action in friendly URL mapping routes.xml file?
Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
Hey Stian, is 6.1 some forgotton Norse island somewhere ? Oh look at the time, it's 2016 already...
I know in 6.2 you'd have to add something like the following for the portlet you want to open up to access an action without the auth token
auth.token.ignore.portlets=82,myportletnamespace
I know in 6.2 you'd have to add something like the following for the portlet you want to open up to access an action without the auth token
auth.token.ignore.portlets=82,myportletnamespace