Foros de discusión

Specify javax.portlet.action in friendly URL mapping routes.xml file?

Phoenix Zerin, modificado hace 12 años.

Specify javax.portlet.action in friendly URL mapping routes.xml file?

Junior Member Mensajes: 60 Fecha de incorporación: 28/06/11 Mensajes recientes
For my MVC plugin portlet, I have the following route defined in my friendly URL mapping file:

<!--?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, modificado hace 12 años.

RE: Specify javax.portlet.action in friendly URL mapping routes.xml file? (Respuesta)

Junior Member Mensajes: 60 Fecha de incorporación: 28/06/11 Mensajes recientes
Figured it out. I needed to add the following:

<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>
thumbnail
Stian Sigvartsen, modificado hace 10 años.

RE: Specify javax.portlet.action in friendly URL mapping routes.xml file?

Regular Member Mensajes: 103 Fecha de incorporación: 27/08/10 Mensajes recientes
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
thumbnail
Jack Bakker, modificado hace 7 años.

RE: Specify javax.portlet.action in friendly URL mapping routes.xml file?

Liferay Master Mensajes: 978 Fecha de incorporación: 3/01/10 Mensajes recientes
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