I have designed a webpage with a single portlet. I want to pass parameters to this portlet. So I am calling my webpage this way (on a local liferay instance): http://localhost:8080/group//?param=1
To avoid misunderstandings, I am not just trying to pass parameters between pages of a portlet (controller to view). I know how to do this and it works fine. In this case I am trying to start my portlet with parameters from the URL hosting it.
My understanding from the docs is that the portlet is not able to access the URL parameters The advised solution that I read about was to use "friendly-url-mapper".
I did not manage to get it to work. Here is what I did so far:
I added into liferay-portlet.xml:
<friendly-url-mapper-class>com.liferay.portal.kernel.portlet.DefaultFriendlyURLMapper</friendly-url-mapper-class>
<friendly-url-mapping>view</friendly-url-mapping>
<friendly-url-routes>friendly-url-routes-for-parameters.xml</friendly-url-routes>
Is view the correct value to set? Real doubt about it.
I created friendly-url-routes-for-parameters.xml with this content:
<routes>
<route>
<pattern>/result?{match}</pattern>
<implicit-parameter name="param">{match}</implicit-parameter>
</route>
</routes>
/result is mapped to a result.jsp page into my controller class (this part works):
I would expect that : http://localhost:8080/group//?param= and / or http://localhost:8080/group///-/view/?param= would redirect to my result.jsp with the ?param= parameter.
What did I not understand correctly?