Reputation: 165
I'm creating a JSF application. I'm facing the following exception:
javax.el.ELException: Not a Valid Method Expression
The line it is referring to is the following:
<h:commandButton action="#{Login.trylogin} "value="#{messages.click}"/>
I also tried #{Login.trylogin()}
, but the result was the same. The bean behind #{Login}
has the following method:
public String trylogin()
In my faces-config.xml
the navigation case is this one:
<navigation-rule>
<from-view-id>login.jsp</from-view-id>
<navigation-case>
<from-action>#{Login.login}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>readPW.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{Login.login}</from-action>
<from-outcome>failed</from-outcome>
<to-view-id>register.jsp</to-view-id>
</navigation-case>
Note: this is a school project, so I can't use alternative ways for navigation such as implicit navigation.
Upvotes: 1
Views: 7372
Reputation: 23381
It seems you have just a 'typo' error
<h:commandButton action="#{Login.trylogin} "value="#{messages.click}"/><br><br>
Fixed version
| here
<h:commandButton action="#{Login.trylogin}" value="#{messages.click}"/><br><br>
Upvotes: 8