Bom estou fazendo uns testes com o Jsf2 e estou tentando subir no jetty, até ai tudo bem porem quando fui tentar usar a estrutura do Faces de template começou a dar um erro estranho, que não consigo achar…
template.xhtml
<?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://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h:outputStylesheet name="css/index.css" />
</h:head>
<h:body>
<h:panelGroup id="container" layout="block">
<ui:include src="menu.xhtml" ></ui:include>//SE EU TIRAR ESTA LINHA TUDO FUNCIONA
<h:panelGroup id="content" layout="block" >
<h:panelGroup id="left" layout="block" styleClass="bordaBox">
<ui:insert name="contentLeft"></ui:insert>
</h:panelGroup>
<h:panelGroup id="center" layout="block" >
<ui:insert name="contentCenter"></ui:insert>
</h:panelGroup>
</h:panelGroup>
</h:panelGroup>
</h:body>
</html>
menu.xhtml
<ui:fragment xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" >
<h:outputText value="UTILIZANDO FRAGMENTOS" />
</ui:fragment>
Quando eu chamo o index com o menu setado no template o jetty lança este erro:
Error Parsing /menu.xhtml: Error Traced[line: 1] Element type “ui:fragment” must be followed by either attribute specifications, “>” or “/>”.
Caused by:
javax.faces.view.facelets.FaceletException: Error Parsing /menu.xhtml: Error Traced[line: 1] Element type "ui:fragment" must be followed by either attribute specifications, ">" or "/>".
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:390)
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:364)
Alguem sabe me dizer se o jetty funciona 100% com o jsf 2 ? ou se é um problema no meu codigo alguem já passou por isso ?