I want to send a mysql request and display the results in a datatable.
I'm using jsf 2.2 and Glassfish server 4.1.1. I've checked several threads in this website but didn't manage to find what I'm doing wrong, which started trying to adapt the project of this website:
http://www.java2s.com/Tutorials/Java/JSF/1900__JSF_DataTable_Add_Delete.htm
So basically I used the code in the UserBean.java but instead of using the demo.xhtml I'm using my own xhtml which is based in it as well:
<!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"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
</h:head>
<h:body>
<h:dataTable value="#{book.bookList}" var="o"
styleClass="book-table"
headerClass="book-table-header"
rowClasses="book-table-odd-row,book-table-even-row">
<h:column>
<f:facet name="header">Book No</f:facet>#{o.bookNo}
</h:column>
<h:column>
<f:facet name="header">Product Name</f:facet>#{o.productName}
</h:column>
<h:column>
<f:facet name="header">Price</f:facet>#{o.price}
</h:column>
<h:column>
<f:facet name="header">Quantity</f:facet>#{o.qty}
</h:column>
<h:column>
<f:facet name="header">Action</f:facet>
<h:commandLink value="Delete" action="#{book.deleteAction(o)}" />
</h:column>
</h:dataTable>
</h:body>
</html>
But instead of displaying the table like this:
Book No Product Name Price Quantity Action
1 CSS 123.12 1 Delete
2 HTML 321.12 2 Delete
3 SQL 12333.3 8 Delete
4 Javascript 1233.33 3 Delete
5 Web 123.22 10 Delete
I get this:
Book No#{o.bookNo} Product Name#{o.productName} Price#{o.price} Quantity#{o.qty} Action
So I'm guessing I'm missing some jar or library? the project includes plenty of them while I only have this one: mysql-connector-java-8.0.15.jar.
For starters I'd like to know which libraries are required to do this operation, since I just don't want to copy/paste everything without knowing what it's used for.
Thanks in advance.