<h:form>
First Name: <h:inputText value="#{studentFormBean.fname}" /> <br/><br/>
Last Name: <h:inputText value="#{studentFormBean.lname}" /> <br/><br/>
Country :
<h:selectOneMenu value="#{studentBean.country}">
<f:selectItem itemValue="Brazil" itemLabel="Brazil" />
<f:selectItem itemValue="US" itemLabel="US" />
<f:selectItem itemValue="UK" itemLabel="UK" />
<f:selectItem itemValue="Myanmar" itemLabel="Myanmar" />
</h:selectOneMenu>
<h:commandButton value="Submit" action="FormResponse"/>
</h:form>
At this code, "#{studentFormBean.fname}"
should point to setFname()
in StudentFormBean.java
but it point to getFname()
. Why is this happened and how can I solve it?