2
내 응용 프로그램의 레이아웃을 따르는 JSF 템플릿을 만들고 있습니다 ... 그래서이 layout.xhtml 페이지를 만들었습니다. 내 브라우저에서 comum.xhtml 페이지에 액세스 할 때 여기 ui : ui로 바뀌지 않는 삽입 : define
<?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:f="http://java.sun.com/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<h:head>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</h:head>
<h:body>
<f:loadBundle basename="mensagens.mensagens_pt_BR" var="msgs" />
<ui:composition>
<div id="page">
<div id="header-container">
<div id="nomeSistema">#{msgs.outNomeSistema}</div>
</div>
<div id="menu-login-container">
<div id="menu"
style="width: 850px; height: 30px; border: solid 1px; padding: 15px;">
<ui:include src="/menu/menu.xhtml" />
</div>
<div id="login">
<ui:include src="/login/login.xhtml" />
</div>
</div>
<div id="content-container">
<div id="content">
<ui:insert name="content">
<h2>Default content</h2>
</ui:insert>
</div>
</div>
<div id="footer-container">
<div id="footer">
<h:outputText value="#{msg.versao}" />
</div>
</div>
</div>
</ui:composition>
</h:body>
</html>
그리고
는 comum.xhtml<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets" template="layout.xhtml">
<ui:define name="content">
<h2>Testando template...</h2>
</ui:define>
</ui:composition>
하지만. 텍스트 기본 내용은 표시되지 않습니다. Testando 템플릿 ....
내가 뭘 잘못하고있어?
template.xhtml의 태그도 작동하지 않습니다. –
brbrbr