I would like to create table which can display data from database into JSF page. I found this code:
<h:dataTable value="#{bookStore.items}" var="store">
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.storeNameLabel}"/>
</f:facet>
<h:outputText value="#{store.name}"/>
</h:column>
<h:column>
<f:facet name="header">
Subject
</f:facet>
<h:outputText value="#{store.subject}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.storePriceLabel}"/>
</f:facet>
<h:outputText value="#{store.price}"/>
</h:column>
</h:dataTable>
When I use this code I get this error message in Netbeans:
javax.faces.view.facelets.FaceletException: Error Parsing /my.xhtml: Error Traced[line: 42] The prefix "f" for element "f:facet" is not bound
If I replace the f
tag with h
tag, is it going to work? Or do I have to include f
tag library?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…