留言板
Multiple parameters in Friendly Url
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>/{category([a-zA-Z0-9]+)[-]?([a-zA-Z0-9]+))*}/{page[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
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>/{category([a-zA-Z0-9]+)[-]?([a-zA-Z0-9]+))*}/{page[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
Vernon Singleton,修改在7 年前。
RE: Multiple parameters in Friendly Url
Expert 帖子: 315 加入日期: 13-1-14 最近的帖子
Hi Xena,
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
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
Thank you Vermon.
your example is useful and easy to understand.
your example is useful and easy to understand.
Vernon Singleton,修改在7 年前。
RE: Multiple parameters in Friendly Url
Expert 帖子: 315 加入日期: 13-1-14 最近的帖子
Thank you for the encouragement.
Enjoy using Liferay Faces.
Enjoy using Liferay Faces.