Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stylesheet file not found by <h:outputStylesheet> [duplicate]

Tags:

css

jsf-2

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

Can anyone please help me to resolve the issue?

like image 295
Sathya Elangovan Avatar asked Feb 06 '13 11:02

Sathya Elangovan


1 Answers

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
 :    

Then you can keep using

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

See also:

  • How to reference CSS / JS / image resource in Facelets template?
like image 136
BalusC Avatar answered Nov 20 '22 11:11

BalusC