xhtmltempl.xhtml
レイアウトがあります。
次のような他の .xhtml に含めます。
<ui:composition template="/template/templ.xhtml">
次のように templ.xhtml で条件を定義します。
<h:head>
<h:outputText value="<!--[if lt IE 8]><h:outputStylesheet library="css" name="styleie8.css" /><![endif]-->" escape="false" />
</h:head>
styleie8.css
templ.xhtml
ロードされていませんが、Tomcat の実行中に何かが変更されて保存された場合、正常にロードされました。
Tomcatの起動時にJSFが条件をすぐにロードする方法は?
注:
次の代替手段を使用しようとしました:
1.
<!--[if lt IE 8]>
<h:outputStylesheet name="styleie8.css" library="css"/>
<![endif]-->
2.
<o:conditionalComment if="lte IE 8">
<link rel="stylesheet" href="styleie8.css" />
</o:conditionalComment>
3. #{request.contextPath}/resources
単純なパスの代わりに。
結果は同じです -条件 css をロードするために .xhtml テンプレートを再保存する必要があります。