java - h:dataTable has no value -


Hello, JSF h has used: Data Table - JSF DataAbple is empty, my SP return value is returned , But only the headers are seen in the browser, table values ​​do not appear in the browser.

My JSP

   & Lt; / Ch: Aspect & gt; & Lt; H: output text value = "# {loc.sponsorID}" /> & Lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; & Lt; H: output text value = "sponsor name" /> & Lt; / Ch: Aspect & gt; & Lt; H: output text value = "# {loc.sponsorName}" /> & Lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; & Lt; H: Output Text Value = "Distributor ID" /> & Lt; / Ch: Aspect & gt; & Lt; H: output text value = "# {loc.distributorID}" /> & Lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; & Lt; H: Output Text Value = "Distributor's Name" /> & Lt; / Ch: Aspect & gt; & Lt; H: output text value = "# {loc.distributorName}" /> & Lt; / H: column & gt; & Lt; / H: datatable & gt; & Lt; / H: panelGrid & gt; & Lt; / H: form & gt;  

My Bean

Public Class DataTableBean {

  Private list & lt; BillTransPay & gt; List; Public listing & lt; Biltranspeck & gt; GetList () {String SP_BILLPAY = "{call sp_aw_Bill trance pay (?,?,?,?,?,?,?)}" Connection con = null; Results set rs = null; Try {class.forName ("com.microsoft.sqlserver.jdbc.SQLServerDriver"); Con = java.sql.DriverManager .getConnection (conString); Callable Stattement cbls = con .prepareCall ("{call sp_aw_Bill trance pay (?,?,?,?,?,?,?)}"); Cbls.setString (1, "CSF"); Cbls.setString (2, "20100101"); Cbls.setString (3, "20100301"); Cbls.setString (4, "B"); Cbls.setString (5, "01CS"); Cbls.setString (6, "ALL"); Cbls.setInt (7, 14000); Rs = cbls.executeQuery (); List = New Arrestist & lt; BillTransPay & gt; (); While (rsnext ()) {BillTranspace BTP = New BillTranspace (); Btp.setSponsorID (rs.getString ("SponsorCode")); Btp.setSponsorName (rs.getString ("SponsorName")); Btp.setDistributorID (rs.getString ("DistID")); Btp.setDistributorName (rs.getString ("DistName")); List.add (BTP); }} Hold (Exception pre) {ex.printStackTrace (); } Return list; } Public Zero set list (list & gt; BillTransPay & gt; list) {this.list = list; }   

}

Faces-Config.xml

  ** & lt; Managed-Bean & gt; & Lt; Managed-name names & gt; DataTableBean & lt; / Managed-name names & gt; & Lt; Successful bean category & gt; Com.SQLProcess.dto.DataTableBean & lt; / Managed-van-class & gt; & Lt; Realm of managed-beams & gt; Request & lt; / Managed-beans scope & gt; & Lt; / Managed-Bean & gt; **    

Just run a debugger or System.out.println (list ); correct back to the list; to see that method is called and the list contains items in actually .

said that this expensive DB job should not really be done in getter . During the request, it can be said many times that you can make your DB unnecessary hit / stress Do not want to enter. Take DB job in the manufacturer of bean Also, you are not explicitly shutting down the DB resources to Connection , Description and ResultSet . In the form of the end same try you need to close them where you have received them.

Comments