Regis Albuquerque
Regis Albuquerque

Reputation: 138

javax.el.ELException: Not a Valid Method Expression when use action property with method and string

I am trying put method and String in a action property of a menuitem (primefaces).

Code:

    <p:submenu label="Permissao" icon="ui-icon-note">
        <p:menuitem value="Editar" action="#{principalTemplateBean.sistemaPath}/permissao/editar" ajax="false"/>
    </p:submenu>

But when I run I got this:

    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)

Upvotes: 1

Views: 1280

Answers (1)

Ingo B&#252;rk
Ingo B&#252;rk

Reputation: 20043

The action attribute is for calling a method in the backing bean, not for navigation. Use outcome or url for that, depending on whether you call an external URL.

You can find more information on this here: link from <p:menuitem> to certain <p:tab>

Upvotes: 1

Related Questions