6

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?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Sathya Elangovan
  • 163
  • 3
  • 14

1 Answers1

11

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:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555