0

I am new to the world of JSF. I am trying to develop a simple program which passes array of books to HTML page. But i am not able to pass the content.

file : index.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"  >
    <h:head>    
    <link type="text/css" rel="stylesheet" href="WEB-INF/table-style.css" />    
    </h:head>
    <h:body>
    <h1>Book Management Table</h1>  
    <h:dataTable value="#{Book.BookList}" var="b" styleClass="BookDetails-table" headerClass="BookDetails-table-header" rowClasses="BookDetails-table-odd-row,BookDetails-table-even-row">
    <h:column>
        <!-- column header -->
        <f:facet name="header">Book Name</f:facet>
        <!-- row record -->
        #{b.bookName}
    </h:column>     
    <h:column>
        <f:facet name="header">Author Name</f:facet>
        #{b.authorName}
    </h:column> 
    <h:column>
        <f:facet name="header">Price</f:facet>
        #{b.price}
    </h:column> 
    <h:column>
        <f:facet name="header">Quantity</f:facet>
        #{b.qty}
    </h:column>
    </h:dataTable>
    </h:body>
</html>

The table has been created in output when i checked source code via browser. But the values are not been passed. Thank you

user007
  • 2,156
  • 2
  • 20
  • 35
  • Does "values are not passed" mean the html table is empty or that the table contains rows, but the cells are empty? What does your backing bean look like, and how do you register it as a backing bean? Have you tried setting a break point in the `getBookList()` method? – meriton Mar 23 '16 at 22:23
  • Hint: Java is case sensitive. Try to not deviate from examples given in learning resources. – BalusC Mar 24 '16 at 08:23

0 Answers0