次を含むテンプレート構成Button.xhtmlがあります<p:commandLink>。
<ui:composition
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:p="http://primefaces.org/ui">
<p:commandLink value="View" action="#{printClass.printPdf}"/>
</ui:composition>
リンクの目的は PDF を生成することです。
が含まれているテンプレート クライアントdefaultPage.xhtmlがありButton.xhtmlます。
<ui:composition template="../../WebPages/MasterPage/Template.xhtml">
<ui:define name="MainContent">
<ui:include src="../../WebPages/Facelets/Button.xhtml"/>
</ui:define>
</ui:composition>
最後の 1 つは、テンプレート定義を a 内Template.xhtmlに挿入するものです。MainContent<h:form>
<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">
<h:body>
<h:form>
<ui:insert name="MainContent" />
</h:form>
</h:body>
</html>
に配置<h:head></h:head>するTemplate.xhtmlと、<p:commandLink>inButton.xhtmlが機能しなくなりますが、ページの CSS は完全に機能します。それまでに削除<h:head></h:head>または交換すると<head></head>、<p:commandLink>動作を開始しますが、CSS は動作を停止します。
これはどのように発生し、どうすれば解決できますか?