ui:composition template ="< jar from jar>" [英] ui:composition template="<template from jar>"

查看:250
本文介绍了ui:composition template ="< jar from jar>"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将JSF的Facelets模板文件放在JAR文件中。

I would like to place the Facelets template file for JSF in a JAR file.

我试图通过EL引用它作为

I tried to reference it by EL as

<ui:composition template="#{resource['templates:template_pe_layout.xhtml']}">

适用于CSS或图像,但不适用于合成模板。

which works perfect for CSS or images, but not for the composition template.

我怎样才能达到目标?

推荐答案

#{资源} 表达式最初设计为仅使用内部 CSS文件

The #{resource} expression is initially designed for use inside CSS files only like so

.someclass {
    background-image: url(#{resource['somelibrary:img/some.png']});
}

不打算在中使用< h: outputStylesheet> < h:outputScript> < h:graphicImage> 应该使用如下:

It's not intented for usage in <h:outputStylesheet>, <h:outputScript> or <h:graphicImage> which should rather be used as follows:

<h:outputStylesheet library="somelibrary" name="css/some.css" />
<h:outputScript library="somelibrary" name="js/some.js" />
<h:graphicImage library="somelibrary" name="img/some.png" />

关于模板,只需指定完整的 / META-INF /资源那里的相对路径。

As to the templates, just specify the full /META-INF/resources relative path in there.

<ui:composition template="/templates/template_pe_layout.xhtml">



参见:



查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆