我有以下友好的URL路由:
<route>
<pattern>/version/{version}</pattern>
<implicit-parameter name="_facesViewIdRender">/WEB-INF/views/portletViewMode.xhtml</implicit-parameter>
<implicit-parameter name="p_p_lifecycle">0</implicit-parameter>
<implicit-parameter name="p_p_mode">view</implicit-parameter>
<implicit-parameter name="p_p_state">normal</implicit-parameter>
</route>
但是当我尝试导航到以下网址时,它不起作用:
localhost:8080/web/guest/home/-/my-portlet/version/1.0
答案 0 :(得分:1)
The default pattern Liferay uses to match parameters is "[^/\\.]+"
。此模式不包括"/"
,"\"
和"."
。您应该设置一个自定义模式,该模式仅排除"/"
和"\"
:"[^/\\]+"
:
<pattern>/version/{version:[^/\\]+}</pattern>