问题
I have a liferay portlet application written in JSF 2 Richfaces deployed under weblogic.
Pages are rendered fine, and it seems that EL resolver does it's job well.
However as soon as I initiate any kind of submit the page simply reloads and nothing happens.
I've found several solutions on the Internet, most of them came down to this solution:
Why isn't Liferay Faces processing JSF portlet action events?
I've also found these liferay-porlet.xml
settings in Liferay's official JSF richfaces showcase application so I've already tried them.
The problem is that as soon as I add:
<requires-namespaced-parameters>false</requires-namespaced-parameters>
To my liferay-porlet.xml
the portlets become invisible so I can't verify if it fixes the issue.
Has anyone came across a similar issue? Does anyone have any suggestions? I've also looked in to suggestions made in this post:
action method is not called in JSF
None of them appear to apply to my case. I've stripped down my application to the bone. It seems like a Liferay issue.
Versions used:
Liferay 7.0
RichFaces 4.5.17
com.liferay.faces.bridge.impl 4.1.1
com.liferay.faces.bridge.ext 5.0.2
com.liferay.faces.bridge.api 4.1.0
javax.faces 2.2.14
回答1:
You have two options:
Add the following to your
WEB-INF/web.xml
file to ensure that JSF handles namespaced parameters correctly:<context-param> <param-name>com.sun.faces.namespaceParameters</param-name> <param-value>true</param-value> </context-param>
Some component libraries may not be able to handle namespaced parameters, but I'm pretty sure that PrimeFaces, IceFaces, and RichFaces can (probably BootsFaces and ButterFaces too).
Add the following to the
<portlet>
section of yourWEB-INF/liferay-portlet.xml
:<requires-namespaced-parameters>false</requires-namespaced-parameters>
It seems like you tried #2, but you may have included the config in the wrong place. That is likely causing an error which in turn causes your portlet to fail to deploy. Check the DTD to ensure that your config is in the right order: https://docs.liferay.com/ce/portal/7.0-latest/definitions/liferay-portlet-app_7_0_0.dtd.html
来源:https://stackoverflow.com/questions/50838124/liferay-7-jsf-actions-not-triggered