0

I have a resources folder on the webapp root. I placed a CSS file named screen.css under resources->login->css and images to be used in styles available in the CSS file are placed unded resources->login->css->images as can be seen in the following picture.

enter image description here

Therefore, an image should be accessible from styles available in the screen.css CSS file as follows.

background: url(images/login_bg.jpg) no-repeat top center;

I set the url attribute everywhere in the screen.css file but no images from the images folder are available to the browser.

What is missing here?


I have done it using the following resource evaluation expression.

background: url("#{resource['login:css/images/login_bg.jpg']}") no-repeat top center;

But why does giving the url attribute a path relative to the given CSS file screen.css does not work in the first case.

Tiny
  • 27,221
  • 105
  • 339
  • 599
  • 1
    Your question has been thoroughly answered here http://stackoverflow.com/questions/12166854/background-url-path-in-a-jsf-template – hoangfin Dec 12 '14 at 08:47
  • And can be solved with http://showcase.omnifaces.org/resourcehandlers/UnmappedResourceHandler – BalusC Dec 12 '14 at 08:55
  • @BalusC : May please close the question as a duplicate. – Tiny Dec 14 '14 at 11:30

0 Answers0