Facelete Template insere 2 vezes a tela cliente

Java

28/03/2014

Pessoal,

Estou trabalha com Faceltes template para criar as tela do sistema, mas percebi que é carregado 2 vezes o código da tela "cliente" do template. Tentei fazer o carregamento tanto com tag html como com ui:composition.

Olha o template:

<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:p="http://primefaces.org/ui">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <h:outputStylesheet name="./css/default.css"/>
        <h:outputStylesheet name="./css/cssLayout.css"/>
        <title>OZELO [Sistema Administrativo]</title>
    </h:head>

    <h:body>
        <div id="container" class="container" align="center">
        <div id="top" class="top">
            <ui:insert name="menu">
                <ui:include src="menu.xhtml"/>
            </ui:insert>
        </div>

        <div id="conteudo" class="conteudo">
            <ui:insert name="conteudo"/>
        </div>
         
      </div>    
    </h:body>
</html>


Agora a tela que sera inserido em "conteudo":

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
       xmlns:h="http://java.sun.com/jsf/html">

   <body>
       <ui:composition template="./../index.xhtml">
            <ui:define name="conteudo">
                <h:form>
                    <p:outputLabel value="Marca"/>
                    <p:inputText value="#{fabricanteMB.novoFabricanteNome}"/>
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>


Ao inspecior a tela no Chrome sai o seguinte html:

<?xml version=''1.0'' encoding=''UTF-8'' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><link type="text/css" rel="stylesheet" href="/v1-web-1.0-SNAPSHOT/faces/javax.faces.resource/theme.css?ln=primefaces-aristo" /><link type="text/css" rel="stylesheet" href="/v1-web-1.0-SNAPSHOT/faces/javax.faces.resource/./css/default.css" /><link type="text/css" rel="stylesheet" href="/v1-web-1.0-SNAPSHOT/faces/javax.faces.resource/./css/cssLayout.css" /><link type="text/css" rel="stylesheet" href="/v1-web-1.0-SNAPSHOT/faces/javax.faces.resource/primefaces.css?ln=primefaces&v=4.0" /><link type="text/css" rel="stylesheet" href="/v1-web-1.0-SNAPSHOT/faces/javax.faces.resource/dock/dock.css?ln=primefaces&v=4.0" /><script type="text/javascript" src="/v1-web-1.0-SNAPSHOT/faces/javax.faces.resource/jquery/jquery.js?ln=primefaces&v=4.0"></script><script type="text/javascript" src="/v1-web-1.0-SNAPSHOT/faces/javax.faces.resource/primefaces.js?ln=primefaces&v=4.0"></script><script type="text/javascript" src="/v1-web-1.0-SNAPSHOT/faces/javax.faces.resource/dock/dock.js?ln=primefaces&v=4.0"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>OZELO [Sistema Administrativo]</title></head><body>
        <div id="container" class="container" align="center">
        <div id="top" class="top"><html xmlns="http://www.w3.org/1999/xhtml"><head><link type="text/css" rel="stylesheet" href="/v1-web-1.0-SNAPSHOT/faces/javax.faces.resource/theme.css?ln=primefaces-aristo" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>OZELO [Sistema Administrativo]</title></head><body>
        <div id="container" class="container" align="center">
        <div id="top" class="top">
<form id="j_idt17" name="j_idt17" method="post" action="/v1-web-1.0-SNAPSHOT/faces/adm/config/editarModelo.xhtml" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_idt17" value="j_idt17" />
<div id="j_idt17:menu" class="ui-dock-top ui-widget"><div class="ui-dock-container-top ui-widget-header"><a tabindex="-1" class="ui-menuitem-link ui-corner-all" href="#"><img src="./resources/img/listClientes.png" /><span>Listagem Clientes</span></a><a tabindex="-1" class="ui-menuitem-link ui-corner-all" href="/v1-web-1.0-SNAPSHOT/faces/adm/config/fabricante.xhtml"><img src="./resources/img/clienteAdd.png" /><span>Novo Cliente</span></a><a tabindex="-1" class="ui-menuitem-link ui-corner-all" href="#"><img src="./resources/img/user.png" /><span>Operadores</span></a><a tabindex="-1" class="ui-menuitem-link ui-corner-all" href="#"><img src="./resources/img/userFem.png" /><span>RSS</span></a></div></div><script id="j_idt17:menu_s" type="text/javascript">PrimeFaces.cw(''Dock'',''widget_j_idt17_menu'',{id:''j_idt17:menu'',position:''top'',maxWidth:50,itemWidth:40,proximity:90,halign:''center''},''dock'');</script><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:0" value="-6137857350199357790:5388388421846236201" autocomplete="off" />
</form>
        </div>

        <div id="conteudo" class="conteudo">
<form id="j_idt23" name="j_idt23" method="post" action="/v1-web-1.0-SNAPSHOT/faces/adm/config/editarModelo.xhtml" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_idt23" value="j_idt23" />
<label id="j_idt23:j_idt24" class="ui-outputlabel ui-widget">Marca</label><input id="j_idt23:j_idt25" name="j_idt23:j_idt25" type="text" class="ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all" /><script id="j_idt23:j_idt25_s" type="text/javascript">PrimeFaces.cw(''InputText'',''widget_j_idt23_j_idt25'',{id:''j_idt23:j_idt25''});</script><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:0" value="-6137857350199357790:5388388421846236201" autocomplete="off" />
</form>
        </div>

           
      </div></body>

</html>
        </div>

        <div id="conteudo" class="conteudo">
<form id="j_idt29" name="j_idt29" method="post" action="/v1-web-1.0-SNAPSHOT/faces/adm/config/editarModelo.xhtml" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_idt29" value="j_idt29" />
<label id="j_idt29:j_idt30" class="ui-outputlabel ui-widget">Marca</label><input id="j_idt29:j_idt31" name="j_idt29:j_idt31" type="text" class="ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all" /><script id="j_idt29:j_idt31_s" type="text/javascript">PrimeFaces.cw(''InputText'',''widget_j_idt29_j_idt31'',{id:''j_idt29:j_idt31''});</script><input type="hidden" name="javax.faces.ViewState" id="j_id1:javax.faces.ViewState:0" value="-6137857350199357790:5388388421846236201" autocomplete="off" />
</form>
        </div>

           
      </div></body>

</html>



A div "conteudo" foi inserida 2 vezes na criação da tela. Alguem poderia me ajudar?

Muito obrigado.
Raphael Ozelo.

Raphael Ozelo.

Curtidas 0
POSTAR