我测试了这个源代码:
豆:
private NewAccountObj na;
public class NewAccountObj {
private int userid;
............
public NewAccountObj(int userid.............) {
this.userid = userid;
............
}
public int getUserid() {
return userid;
}
...............
}
// Getters
public NewAccountObj getDataList() {
return na;
}
JSF 页面:
<h:panelGrid columns="2">
<h:panelGroup>User ID</h:panelGroup>
<h:panelGroup>
<h:inputText id="userid" value="#{bean.dataList['userid']}">
</h:inputText>
</h:panelGroup>
......................
</h:panelGrid>
当我提交表格时,我得到Target Unreachable, 'null' returned null
. 你能帮我找出问题吗?Maye 这不是访问 Java 对象的正确方法h:panelGrid
吗?
PS:
我在 Glassfish 日志中收到此错误消息:
javax.el.PropertyNotFoundException: /NewAccount.xhtml @38,126 value="#{NewAccountController.dataList['userid']}": Target Unreachable, 'null' returned null