javax.faces.view.facelets.FaceletException: Error Parsing /my.xhtml: Error Traced[line: 42] The prefix “f” for element “f:facet” is not bound

岁酱吖の 提交于 2019-11-28 02:02:10
Matt Handy

You have to inlude the correct taglib for the f prefix.

Here is an example for a 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 to read a JSF tutorial, you can find links in our JSF wiki page.

Replacing the f with h won't work, since there's no h:facet (in the JSF html taglib which is likely to be assigned to the h prefix). You'll have to include the appropriate taglib (JSF core) and assign it to the f prefix.

Include taglib. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!