NumberFormatException for input String [duplicate]

你。 提交于 2019-11-28 10:02:19

So,

<h:outputText value="#{item.rentid}" />

is causing this:

java.lang.NumberFormatException: For input string: "rentid"
    ...
    at javax.el.ArrayELResolver.getValue(ArrayELResolver.java:195)
    ...
    at javax.faces.component.UIOutput.getValue(UIOutput.java:168)

Are you running the code you think you're running? The involvement of ArrayELResolver in the stacktrace indicates that #{item} is actually an array like Object[]. Array values can only be obtained by an integer index like #{item[0]}, but you're accessing it with a string rentid as #{item.rentid} which caused this exception.

Ensure that RentController#getTopMembers() returns a List<Rent>, not List<Object[]> and that the correct version of RentController is been declared as #{rentController} managed bean.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!