This is my css file registrationStyle.css:
body{ background-image: url("#{resources['images/blue.jpg']}"); } My JSF page:
<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"> <h:head> <title>User Registration</title> <h:outputStylesheet library="css" name="registrationStyle.css"/> </h:head> <h:body> This is registration page </h:body> </html> The project structure:

But it can't display image!
UPDATE
I want to using <h:graphicImage tage:
<h:graphicImage name="images/t1.jpg" library="default"/> And i tried this:
<h:graphicImage name="t1.jpg" library="images"/> But it says Unable to find resource default, images/t1.jpg ?

background-image: url("#{resource['images/blue.jpg']}");instead. Pay close attention at#{resource[...]}. It is not#{resources[...]}.resource. It isresourcesas it was before. The resource identifier here#{resource[...]}is however,resource.