开发者

Linking to a CSS file in JSF?

开发者 https://www.devze.com 2023-03-02 13:41 出处:网络
Within <h:head/> tags I have: <h:outputStylesheet name=\"css/common.css\" /> This is outpu开发者_开发问答t as:

Within <h:head/> tags I have:

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

This is outpu开发者_开发问答t as:

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

The stylesheet is within a folder named css under the webapp folder of my maven war. When I browse to http://localhost:8080/mywar/css/common.css I see the stylesheet.

Any ideas what I'm missing? Thanks in advance.


I followed the directory structure and layout from tip 4 here: http://www.ibm.com/developerworks/java/library/j-jsf2fu1/index.html

Essentially moved the css folder to be under one called resources and then referenced it as:

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

Now it seems to work!

0

精彩评论

暂无评论...
验证码 换一张
取 消