I'm trying to show a list of all records in my database. My view looks like :
<?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://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
Hello from Facelets
<h:dataTable var="p" value="#{productController.findAll()}"
border="1" cellpadding="2" cellspacing="2">
<h:column>
<f:facet name="header">Id</f:facet>
<h:outputText value="#{p.id}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">Name</f:facet>
<h:outputText value="#{p.name}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">Price</f:facet>
<h:outputText value="#{p.price}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">Quantity</f:facet>
<h:outputText value="#{p.quantity}"></h:outputText>
</h:column>
</h:dataTable>
</h:body>
</html>
I hava a war and ejb project. In my ejb project I made a created an entity of my database table named product. Also I created a new package named model which include "AbstractFacade" and "ProductFacade". Now in my war project, I created a package named "controller". Here I want to make a link to the view. When I try to create a new JSF Managed bean (I used as scope : Session) and use this code:
@Named(value= "productController")
@SessionScoped
@ManagedBean
public class ProductController implements Serializable {
@EJB
private ProductFacade productFacade;
private Product product = new Product();
public List<Product> findAll(){
return this.productFacade.findAll();
}
}
I always get this error when I try to deploy my project :
/Users/Wutz/NetBeansProjects/BankApp/BankApp-war/nbproject/build-impl.xml:1051: The module has not been deployed.
See the server log for details.
When I have a look at this line it tells me this:
<nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
Anyone who can tell what i'm doing wrong? I can't figure this out.