Javax.faces.view.facelets.FaceletException: Error parsing /my.xhtml: Trace error [line: 42] "f" prefix for "f: facet" element is not associated

I would like to create a table that can map data from a database to a JSF page. I found this code:

<h:dataTable value="#{bookStore.items}" var="store">
    <f:facet name="header">
      <h:outputText  value="#{msg.storeNameLabel}"/>
    <h:outputText value="#{}"/>
    <f:facet name="header">
    <h:outputText value="#{store.subject}"/>
    <f:facet name="header">
      <h:outputText  value="#{msg.storePriceLabel}"/>
    <h:outputText value="#{store.price}"/>


When I use this code, I get this error message in Netbeans:

javax.faces.view.facelets.FaceletException: error parsing /my.xhtml: error in trace [line: 42] "f" prefix for "f: facet" element is not associated

If you replace a tag f

with a tag h

, will it work? Or do I need to include the tag library f



source to share

3 answers

You must include the correct taglib for the f prefix.

Below is an example of a FaceSpace 2.2 page:

<!DOCTYPE html>
<html xmlns=""



If you are still using JSF 2.0 / 2.1 then use domain

instead of domain

in XML namespace.

I recommend reading the JSF tutorial, you can find links in our JSF wiki page .



Replacing f

with h

won't work as there isn't h:facet

(in the JSF html taglib that can be prefixed h

). You will need to include the appropriate taglib (JSF core) and prefix it f




Include taglib. <%@ taglib uri="" prefix="f" %>



All Articles