2

テンプレートを使用しているページがあります

<ui:composition template="/WEB-INF/facelets/templates/clientPage.xhtml">

メタタグを使用して、この特定のページの互換性ビューのみをレンダリングすることを望んでいました

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

ルート テンプレート ページに追加しないとタグが機能しません。テンプレートを使用する特定のページに追加する方法はありますか。

4

1 に答える 1

1

<ui:insert>マスター テンプレートの目的の場所で を宣言します。

clientPage.xhtml

<!DOCTYPE html>
<html ...>
    ...
    <h:head>
        <ui:insert name="head-meta" />
        ...
    </h:head>
    ...
</html>

マスター テンプレートを別のマスター テンプレートで拡張します。

i18ClientPage.xhtml

<ui:composition template="/WEB-INF/facelets/templates/ie8ClientPage.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
>
    <ui:define name="head-meta">
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    </ui:define>
</ui:composition>

最後に、それらのテンプレート クライアントが代わりにこのマスター テンプレートを使用できるようにします。

于 2013-10-30T10:30:28.090 に答える