我正在尝试在primefaces移动项目中使用facelets模板,我在第一个片段中创建了defaultTemplate,然后我在第二个片段中创建了模板客户端但是在这里我无法获得内容,是否有解决方案?
<?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: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"
xmlns:pm="http://primefaces.org/mobile"
renderKitId="PRIMEFACES_MOBILE"
>
<f:view renderKitId="PRIMEFACES_MOBILE">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<ui:insert name="header">
<pm:page title="Hello World">
<pm:header title="Header" />
</pm:page>
</ui:insert>
<h:body>
<ui:insert name="body">
</ui:insert>
</h:body>
</f:view>
</html>
1-Faceletes模板摘录
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition 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="./defaultTemplate.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:pm="http://primefaces.org/mobile"
>
<f:view renderKitId="PRIMEFACES_MOBILE">
<ui:define name="body">
<pm:view id="second">
<pm:header title="Second View Header" />
<pm:content>
Second View Page
</pm:content>
</pm:view>
</ui:define>
</f:view>
</ui:composition>
2-Template Client代码段