Problema com Template: JSF + PrimeFaces

1 resposta
E

oi sou iniciante em desenvolvimento web e estou tendo algumas dificuldades com templates
quando seleciono um item no menu, ex Apartamento ele joga pra minha pagina criada mais exibe a seguinte mensagem:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

ttt

minha index.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">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="temp/template.xhtml">
    
</ui:composition>

meu template.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<f:view xmlns="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"
        xmlns:f="http://java.sun.com/jsf/core">  
    <html>
        <h:head> 
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
            <link type="text/css" rel="stylesheet" href="temp/estilo.css"/>  
            <title>SGH - Sistema de Gestão de Hotéis</title> 
        </h:head>  

        <h:body>  
            <h:form id="form">  
                <ui:insert name="cabecalho">
                    <center><h:graphicImage value="img/logoSGI.png"/></center>
                </ui:insert>
                <ui:include src="menu.xhtml">
                </ui:include>

                <div class="corpo">
                    <h:messages id="mensagens" globalOnly="true" />
                    <ui:insert name="corpo" />
                </div>  
            </h:form>
        </h:body> 
    </html> 
</f:view>

meu menu.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<p:toolbarGroup xmlns:p="http://primefaces.org/ui">

    <p:menubar>
        <p:submenu label="Cadastros">
            <p:menuitem value="Apartemanto" url="apartamento/pesquisar.xhtml"/>  
            <p:menuitem value="Funcionário" action="pagina2" />  
            <p:menuitem value="Hospede" action="pagina3" />  
        </p:submenu>
        <p:menuitem value="Hospedagem"/>
    </p:menubar>

</p:toolbarGroup>

e a minha pagina de pesquisar.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="temp/template.xhtml">
    
    <ui:define name="corpo">
        ttt
    </ui:define>
    
</ui:composition>

além disso ele tambem ta reclamando de que o menu precisa de um form:

The button/link/text component needs to have a Form in its ancestry. Please add .

se alguem puder me ajudar eu agradeço muito :)

1 Resposta

d34d_d3v1l

Mude o tua pagina para cliente para:

<ui:composition xmlns="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"
	xmlns:f="http://java.sun.com/jsf/core"
	template="/temp/template.xhtml">


	<ui:define name="corpo">

Mude o teu template para:

<?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.org/ui">

<h:head>

...
Criado 14 de dezembro de 2012
Ultima resposta 15 de dez. de 2012
Respostas 1
Participantes 2