I am new to JavaServer Faces and I am trying to do the following:
The template file "/template.xhtml" loads the stylesheet using
<h:outputStylesheet library="style" name="default.css" />
In this CSS file, I want to reference the images as follows:
... background-image: url(LINK_TO_MY_IMAGE) ...
How do I reference this image (what should I write in LINK_TO_MY_IMAGE)? I already tried using a direct link (/contextroot/resources/images/foo.png) and JSF resource notation (/contextroot/faces/javax.faces.resource/foo.png?ln=images).
My directory structure:
/resources/images => contains image files /resources/style/default.css /WEB-INF/web.xml /WEB-INF/faces-config.xml /template.xhtml /demoPage.xhtml => uses the template.xhtml
So my problem is that I always get "404 Not Found" to load these images.
css resources jsf jsf-2
Jan Bunschoten
source share