我正在尝试将方法和String放在menuitem(primefaces)的action属性中。
代码:
<p:submenu label="Permissao" icon="ui-icon-note">
<p:menuitem value="Editar" action="#{principalTemplateBean.sistemaPath}/permissao/editar" ajax="false"/>
</p:submenu>
但是当我跑步时我得到了这个:
Caused by: javax.el.ELException: Not a Valid Method Expression: #{principalTemplateBean.sistemaPath}/permissao/editar
at com.sun.el.lang.ExpressionBuilder.createMethodExpression(ExpressionBuilder.java:311)
at com.sun.el.ExpressionFactoryImpl.createMethodExpression(ExpressionFactoryImpl.java:96)
at org.jboss.weld.util.el.ForwardingExpressionFactory.createMethodExpression(ForwardingExpressionFactory.java:43)
at org.jboss.weld.el.WeldExpressionFactory.createMethodExpression(WeldExpressionFactory.java:53)
at org.jboss.weld.util.el.ForwardingExpressionFactory.createMethodExpression(ForwardingExpressionFactory.java:43)
at org.jboss.weld.el.WeldExpressionFactory.createMethodExpression(WeldExpressionFactory.java:53)
at com.sun.faces.facelets.tag.TagAttributeImpl.getMethodExpression(TagAttributeImpl.java:240)
答案 0 :(得分:1)
action属性用于调用辅助bean中的方法,而不是用于导航。根据您是否调用外部URL,使用结果或URL。
您可以在此处找到有关此内容的更多信息:link from <p:menuitem> to certain <p:tab>