Olá nao sei se eh problema de versao ou algo do tipo…selecionei no eclipse pra usar jsf 2.0 mais ele crio uma pasta no libraries jsf1.2 (Sun RI) …
Eu gostaria de criar um menu lateral, topo e rodapé e de a cordo que clica no link att apenas o corpo do site, de preferencia sem recarregar a pagina toda…
puxo o template mais nao aparece as coisas do Template e nao de erro nenhum, apenas nao aparece.
add Faces-config.xml
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
web.xml
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
teste.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">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:t="http://myfaces.apache.org/tomahawk"
>
<ui:composition template="Template.xhtml">
<ui:define name="esquerda">
<br/>
<a href="cadastrar.jsf">Cadastrar Veiculos</a><br/><br/>
<a href="index.jsf">Logout</a>
</ui:define>
<ui:define name="conteudo">
<center>
<h:form id="form">
<h:dataTable id="tabela" value="#{veiculoMB.listar}" rowClasses="linha1, linha2" var="n" rows="5" rendered="true">
<h:column>
<f:facet name="header">Modelo</f:facet>
#{n.modelo}
</h:column>
<h:column>
<f:facet name="header">Marca</f:facet>
#{n.marca}
</h:column>
//...
</h:dataTable>
</h:form>
</center>
</ui:define>
<ui:define name="direita">
<a4j:form>
<div id="atualizar">
//...
</div>
</a4j:form>
</ui:define>
</ui:composition>
</html>
Template.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">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
//Aqui importar folha de estilos...
<ui:insert name=?titulo?>Revendas.com</ui:insert>
</head>
<body>
<div id="geral">
<div id="topo">
<ui:insert name="topo"></ui:insert>
</div>
<div id="esquerda">
<ui:insert name="esquerda"></ui:insert>
</div>
<div id="conteudo">
<ui:insert name="conteudo"></ui:insert>
</div>
<div id="direita">
<ui:insert name="direita"></ui:insert>
</div>
<div id="rodape">
<ui:insert name="rodape">Copyright ...</ui:insert>
</div>
</div>
</body>
</html>
Obrigado…