< h:outputStylesheet>找不到样式表文件. [英] Stylesheet file not found by <h:outputStylesheet>
本文介绍了< h:outputStylesheet>找不到样式表文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试使用下面的标记在JSF2中包含样式表
Trying to include stylesheet in JSF2 using below tag
<h:outputStylesheet name="css/test.css" />
但是没有选择,样式表的目录结构如下
However it's not picking and the directory structure of the stylesheet as follows
WebContent-> css-> test.css
WebContent-->css-->test.css
任何人都可以帮助我解决问题吗?
Can anyone please help me to resolve the issue?
推荐答案
<h:outputStylesheet>
(以及<h:outputScript>
和<h:graphicImage>
)从特殊的/resources
子文件夹引用JSF资源.只需创建该子文件夹,然后将css/test.css
放在其中即可.
The <h:outputStylesheet>
(and <h:outputScript>
and <h:graphicImage>
) refers JSF resources from the special /resources
subfolder. Just create that subfolder and put your css/test.css
in there.
WebContent
|-- resources
| `-- css
| `-- test.css
:
然后您可以继续使用
<h:outputStylesheet name="css/test.css" />
另请参见:
- 如何在Facelets中引用CSS/JS/图像资源模板?
- How to reference CSS / JS / image resource in Facelets template?
See also:
这篇关于< h:outputStylesheet>找不到样式表文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文