Hello,
I'm just learning the basics of JSF and I have gotten myself confused just working through some simple navigation.
Here's my code:
JSF Page:
<h:form>
<h:link value="Index 1" outcome="#{menuBean.index}" />
<h:commandLink value="Index 2" action="#{menuBean.index}" />
</h:form>
MenuBean:
package edu.unmc.codawards.beans;
import java.io.Serializable;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
@Named
@RequestScoped
public class MenuBean implements Serializable{
private String index = "index"
public String getIndex() {
return index;
}
}
Index 1 works just fine but Index 2 gives me a "javax.el.MethodNotFoundException: /WEB-INF/CODAwardsTemplate.xhtml @27,87 action="#{menuBean.index}": Method not found:
[email protected]()"
If I change my MenuBean getIndex method to just index I can get the action to work with action="#{menuBean.index()}"
While it works, this has me worried since all of the tutorials I am working through seem to treat both the outcome and action attributes the same with no need to include "()"
Surely I'm missing something so incredibly basic but I would appreciate any help I can get
Thanks
Calvin