4

<h:head/>标签内我有:

<h:outputStylesheet name="css/common.css" />

这是输出为:

<link type="text/css" rel="stylesheet" href="RES_NOT_FOUND" />

样式表位于我的 maven war 的 webapp 文件夹下名为 css 的文件夹中。当我浏览到http://localhost:8080/mywar/css/common.css时,我看到了样式表。

有什么我想念的想法吗?提前致谢。

4

1 回答 1

9

我在这里遵循技巧 4 中的目录结构和布局:http: //www.ibm.com/developerworks/java/library/j-jsf2fu1/index.html

本质上将 css 文件夹移动到名为资源的文件夹下,然后将其引用为:

<h:outputStylesheet library="css" name="common.css" />

现在它似乎工作了!

于 2011-05-02T19:34:45.493 回答