在JSF中显示数据库中的数据时出现问题

时间:2011-05-30 13:17:35

标签: java jsf jsf-2 el

我在运行page.jsp:

时遇到问题
Exception while calling encodeEnd on component : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /compteListe.jsp][Class: javax.faces.component.html.HtmlDataTable,Id: j_id_jsp_1879226420_1][Class: javax.faces.component.UIColumn,Id: j_id_jsp_1879226420_2][Class: javax.faces.component.html.HtmlOutputText,Id: j_id_jsp_1879226420_4]}

引起:

org.apache.jasper.el.JspPropertyNotFoundException - /compteListe.jsp(29,13) '#{l.Identifiant}' Property 'Identifiant' not found on type com.bankonet.bean.Compte

但当我做System.out.println (rs.getString (1)); ...时,它运作良好并显示数据!!

2 个答案:

答案 0 :(得分:2)

除非属性名称本身实际上以2个大写字母开头,否则EL中的属性名称需要以小写字母开头,因此:

#{l.identifiant}

这需要名为public的{​​{1}} no-arg getter方法。

答案 1 :(得分:0)

org.apache.jasper.el.JspPropertyNotFoundException - /compteListe.jsp(29,13) '#{l.Identifiant}' Property 'Identifiant' not found on type com.bankonet.bean.Compte

它使用标准的setter / getter方法在类Identifiant中搜索名为com.bankonet.bean.Compte的字段,但是找不到它,因此错误

  

但是当我做System.out.println(rs.getString(1)); ...时,它运行良好并显示数据!!

它与您的问题无关。您需要传递一个集合才能查看以生成视图

相关问题