Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linking to a CSS file in JSF?

Within <h:head/> tags I have:

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

This is output 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.

like image 750
rich Avatar asked Jan 20 '23 20:01

rich


1 Answers

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!

like image 113
rich Avatar answered Jan 23 '23 05:01

rich