I tried many ways to include a background image in my jsf page but none of them worked. Althought my page recognizes my stylesheet (because it displays the text red), but doesn't include the image. Should I add a mapping resource in my pom.xml ? Please advise.
This is my folder structure:
`WebContent
|-- META-INF
|-- WEB-INF
|-- resources
| |-- css
| | |-- style.css
| |-- images
| |-- background.png
|-- index.xhtml
This is what I added in index.xhtml:
<h:body class="main">
<h:outputStylesheet library="css" name="index.css"></h:outputStylesheet>
<p class="test"> some text </p>
</h:body>
And this is my style.css:
.main {
background-image: url("#{resource['images:background.png']}");
}
.test {
color : red;
}