Pessoal
Quando eu vou fazer um teste do template, ele acusa o seguinte erro:
/templates/interna.xhtml @27,62 <ui:include src="/pages/restrito/menu_sistema.xhtml"> Invalid path : /pages/restrito/menu_sistema.xhtml
javax.faces.view.facelets.TagAttributeException: /templates/interna.xhtml @27,62 <ui:include src="/pages/restrito/menu_sistema.xhtml"> Invalid path : /pages/restrito/menu_sistema.xhtml
at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:109)
at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:109)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:94)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:131)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:162)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:114)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:94)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:89)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:94)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:79)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:304)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:363)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:342)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:196)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:151)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:89)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:79)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:148)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:734)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:96)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:311)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at requisicao.web.filter.ConexaoHibernateFilter.doFilter(ConexaoHibernateFilter.java:32)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
O q estou fazendo errado ? Vou colar os codigos das telas aqui…
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">
<ui:composition template="/templates/interna.xhtml">
<ui:define name="titulo">
</ui:define>
<ui:define name="corpo">
Este será corpo <br/> da página
</ui:define>
</ui:composition>
</html>
interna.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:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"> <!-- (1) -->
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title><ui:insert name="titulo">Requisição de Material</ui:insert></title> <!-- (2) -->
<h:outputStylesheet library="css" name="estilo.css"/>
<style type="text/css"><!--
#logotipo {
text-align: right;
float: right;
} -->
</style>
</h:head>
<h:body>
<div id="container">
<div id="titulo">
<ui:insert name="titulo">Resquisição de Material</ui:insert><!-- (4) -->
</div>
<div id="logotipo">
<h:graphicImage library="imagens" name="logotipo_m_SR.png"/>
</div>
<div id="barra_menu">
<ui:insert name="barra_menu">
<ui:include src="/pages/restrito/menu_sistema.xhtml"/>
</ui:insert>
</div>
<div id="corpo">
<ui:insert name="corpo"/>
</div>
<div id="rodape">
<ui:insert name="rodape">
<ui:include src="/pages/publico/rodape.xhtml"/>
</ui:insert>
</div>
</div>
</h:body>
</html>
principal.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:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title><ui:insert name="titulo">Resquição de Material</ui:insert></title>
<h:outputStylesheet library="css" name="estilo.css"/>
<style type="text/css"><!--
#logotipo {
text-align: center;
} -->
</style>
</h:head>
<h:body>
<div id="container">
<div id="logotipo">
<h:graphicImage library="imagens" name="logotipo_g_SR.png"/>
</div>
<div id="barra_menu">
<ui:insert name="barra_menu">
<ui:include src="/pages/restrito/menu_sistema.xhtml"/>
</ui:insert>
</div>
<div id="corpo">
<ui:insert name="corpo"/>
</div>
<div id="rodape">
<ui:insert name="rodape">
<ui:include src="/pages/publico/rodape.xhtml"/>
</ui:insert>
</div>
</div>
</h:body>
</html>
menu_sistema.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:sec="http://www.springframework.org/security/facelets/tags">
<ui:composition>
<sec:ifAnyGranted roles="ROLE_USUARIO">
<h:form id="menu">
<table width="100%">
<tr>
<td>
<h:commandButton value="Contas" action="/restrito/conta"/>
<h:commandButton value="Categorias" action="/restrito/categoria" />
<h:selectOneMenu value="#{contextoBean.contaAtiva.conta}"
valueChangeListener="#{contextoBean.setContaAtiva}"
rendered="#{!empty contextoBean}"
onchange="submit()">
<f:selectItems value="#{contaBean.lista}"
var="conta"
itemValue="#{conta.conta}"
itemLabel="#{conta.descricao}"/>
</h:selectOneMenu>
<h:commandButton value="Lançamentos" action="/restrito/lancamento"/>
<h:commandButton value="Cheque" action="/restrito/cheque" />
<h:commandButton value="Ações" action="/restrito/acao" />
</td>
<td align="left">
<sec:ifAnyGranted roles="ROLE_ADMINISTRADOR">
<h:commandLink action="/admin/principal" title="Administrativo">
<h:graphicImage library="imagens" name="administrativo16.png" />
</h:commandLink>
</sec:ifAnyGranted>
<h:commandLink action="/restrito/principal" title="Principal">
<h:graphicImage library="imagens" name="principal16.png" />
</h:commandLink>
<h:outputLink value="javascript:void(0)" onclick="document.location='#{request.contextPath}/j_spring_security_logout'" title="Sair">
<h:graphicImage library="imagens" name="logout16.png" />
</h:outputLink>
</td>
</tr>
</table>
</h:form>
</sec:ifAnyGranted>
</ui:composition>
</html>
rodape.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">
<ui:composition>
::::::::::::::::::::::::: Requisicao de Material :::::::::::::::::::::::::
</ui:composition>
</html>