掲示板

Multiple parameters in Friendly Url

7年前 に Tsena N によって更新されました。

Multiple parameters in Friendly Url

New Member 投稿: 2 参加年月日: 16/08/11 最新の投稿
Hi there.
I have a problem that I can not get the correct value of 2nd parameter from friendly url mapping of portlet in JSF

For only 1 parameter it works well.

I followed this as a reference:

https://zenidas.wordpress.com/recipes/liferay-friendly-url-using-jsf/


my route is defined as:

<route>
<pattern>/{categoryemoticon([a-zA-Z0-9]+)[-]?([a-zA-Z0-9]+))*}/{pageemoticon[0-9]+)*}</pattern>
<implicit-parameter name="p_p_id">_category_WAR_category_</implicit-parameter>
<implicit-parameter name="p_p_lifecycle">0</implicit-parameter>
<implicit-parameter name="p_p_state">normal</implicit-parameter>
<implicit-parameter name="p_p_mode">view</implicit-parameter>
<implicit-parameter name="_facesViewIdRender">/WEB-INF/category/list.xhtml</implicit-parameter>
</route>

Then I call my URL as:

http://localhost:8080/category/food/3

But both category and page parameters are receiving the same value = food.

Any help with this?

Thank you in advance,
Xena
thumbnail
7年前 に Vernon Singleton によって更新されました。

RE: Multiple parameters in Friendly Url

Expert 投稿: 315 参加年月日: 13/01/14 最新の投稿
Hi Xena,

Tsena N:
Then I call my URL as:

http://localhost:8080/category/food/3

But both category and page parameters are receiving the same value = food.

I am not sure how the "parameters are receiving the same value", but this might help ... you could look at our jsf-showcase-portlet which uses friendly urls with 3 main parameters called componentPrefix, componentName, and componentUseCase.

Here are the routes for that portlet. You can search for ViewParameters in the source code to see how we populate them and use them.

If you are still having problems, please use one of our archetypes to create a short, self-contained example of your issue, and I would be happy to help you further.

Hope that helps,
Vernon
7年前 に Tsena N によって更新されました。

RE: Multiple parameters in Friendly Url

New Member 投稿: 2 参加年月日: 16/08/11 最新の投稿
Thank you Vermon.
your example is useful and easy to understand.
thumbnail
7年前 に Vernon Singleton によって更新されました。

RE: Multiple parameters in Friendly Url

Expert 投稿: 315 参加年月日: 13/01/14 最新の投稿
Thank you for the encouragement.
Enjoy using Liferay Faces.