Um ou mais recursos possuem o destino de 'head'... jsf 2 + facelets + primefaces + template
7 respostas
S
siesler
Bom dia pessoal.
Estou desenvolvendo um aplicativo utilizando jsf 2.1 facelets + primefaces 3.4 + template e estou recebendo o erro abaixo ao carregar o template:
Um ou mais recursos possuem o destino de 'head', mas nenhum componente de 'head' foi definido na exibição.
Pesquisei sobre o assunto e em todos os posts, a solução dada é trocar a tag por <h:head>, no entanto, meu template já está com a tag <h:head>, conforme abaixo:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:ui="http://java.sun.com/jsf/facelets"xmlns:h="http://java.sun.com/jsf/html"xmlns:p="http://primefaces.org/ui"><h:head><title>JVMSOFTWARE - DELIVERY</title></h:head><h:body><divid="dtopo"align="center"><ui:insertname="topo"><ui:includesrc="/topo/topo.xhtml"/></ui:insert></div><br/><divid="dmenu"align="center"><ui:insertname="menu"><!-- se utilizado em sistema diferente, alterar sistem na construção do param --><ui:includesrc="http://localhost:8081/Delivery/menu/menu.xhtml?param=#{loginBean.usr}:DLV"/></ui:insert></div><br/><p:messages/><divid="dprincipal"align="center"><ui:insertname="principal"></ui:insert></div></h:body></html>
Já tentei incluir a tag <h:head> nas paginas de composição, mas continua com problema.
Vocês tem alguma idéia de porque isso pode estar ocorrendo? podem ajudar?
clientesConsulta.xhtml (chamada pela pagina clientes.xhtml):
<?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xmlns:h="http://java.sun.com/jsf/html"xmlns:f="http://java.sun.com/jsf/core"xmlns:p="http://primefaces.org/ui"><h:form><divalign="center"><br/><br/>
consulta de clientes<br/><h:panelGridcolumns="2"cellpadding="5"><h:outputLabelstyle="font-size: small"for="telefone"value="Telefone"/><p:inputTextsize="9"style="font-size: small"value="#{clientesBean.telefone}"id="telefone"label="telefone"/><h:outputLabelstyle="font-size: small"for="documento"value="CPF/CNPJ:"/><p:inputTextstyle="font-size: small"value="#{clientesBean.cpfCnpj}"id="documento"label="documento"/><h:outputLabelstyle="font-size: small"for="nome"value="nome:"/><p:inputTextstyle="font-size: small"value="#{clientesBean.nome}"id="nome"label="nome"/></h:panelGrid><p:commandButtonid="submitButton"icon="ui-icon-search"value="pesquisar"ajax="true"update=":formCliente:tabelaClientes"oncomplete="dlg.hide();"action="#{clientesBean.listCliente}"><f:setPropertyActionListenertarget="#{clientesBean.empresa}"value="#{loginBean.empresa}"/></p:commandButton></div></h:form></html>
tentei uncluir na clientesConsulta.xhtml
<h:head><p:resources/></h:head>
mas mesmo assim continua com a mensagem de head
obrigado
S
siesler
reparei que no <h:head> sempre está com alerta na IDE: content is being hidden from the validator based on namespace filtering
estou usando netbeans 7.3
Att:
D
david_ware
Estranho isso, criei um projeto aqui, adicionei esses arquivos, apenas tirando referências a beans e coisas do tipo, e não apareceu essa mensagem que você falou.
Em compensação, apareceu uma outra:
Tente fazer o seguinte: Veja se no seu arquivo web.xml está desse jeito: