Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF 2.0 How to link CSS from resources folder

I'm designing the template for my new JSF2.0 App and I want to use the resources folder to store my css-file. Now I started to create a template-file, but I don't know how to link the css.

I tried:

<link rel="stylesheet" type="text/css" href="resources/css/style.css"/>

..but didn't work

Can somebody help me, pls. THX


<h:outputStylesheet library="css" name="style.css" target="head" />

That doesn't work either :-(


It still doesn't work! Maybe that resource-method is disabled?! It doesn't work with pictures either!

<h:graphicImage value="#{resource['img:logo.png']}"/>

The output in my browser looks like that:

<img src="RES_NOT_FOUND">

EDIT: Images working now. I stupidly set a wrong path -.- but the stylesheet is still not working

like image 639
Sven Avatar asked Dec 22 '22 01:12

Sven


1 Answers

Make sure you have h:head/h:body tags.

like image 184
mikalaj Avatar answered Dec 28 '22 05:12

mikalaj