I'm stuck with JSF RI 1.1_02 and seeing this problem.
Here's the Facelet code I'm expecting to work:
<h:form>
<h:selectOneMenu value="#{bean.num}" converter="javax.faces.Integer">
<f:selectItem itemLabel="one" itemValue="1" />
<f:selectItem itemLabel="two" itemValue="2" />
<f:selectItem itemLabel="three" itemValue="3" />
</h:selectOneMenu>
<h:commandButton value="submit" />
<h:messages />
</h:form>
The request scoped bean:
public class Bean {
private int num;
public void setNum(Integer aNum) {
num = aNum;
}
public Integer getNum() {
return num;
}
}
I'm receiving Validation Error: Value is not valid and can't imagine what I'm doing wrong already when I've written so little code which shouldn't need any converter. Am I missing something obvious or is this a bug in JSF RI 1.1_02?
I can get around the problem by simply changing the property type in the backing bean to String
but am just frustrated by having to do that when (automatic) conversion is supposed to be there for me.