jsf - javax.faces.view.facelets.FaceletException: Error Parsing /my.xhtml: Error Traced[line: 42] The prefix "f" for element "f:facet" is not bound -
i create table can display data database jsf page. found 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 use code error message in netbeans:
javax.faces.view.facelets.faceletexception: error parsing /my.xhtml: error traced[line: 42] prefix "f" element "f:facet" not bound
if replace f
tag h
tag, going work? or have include f
tag library?
you have inlude correct taglib f prefix.
here example jsf 2.2 facelet page:
<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core"> ... </html>
in case you're still on jsf 2.0/2.1, use java.sun.com
domain instead of xmlns.jcp.org
domain in xml namespace.
i recommend read jsf tutorial, can find links in our jsf wiki page.
Comments
Post a Comment