0

In a JSF2, i'm trying as this say, to put a background image inside the css folder to avoid the #{resource} reference, being the last option from BalusC:

Much better, however, is to store the CSS-included images in the CSS folder, so that you don't need to fiddle with #{resource} in the CSS.

But when following his instructions, the stylesheet link is built as

<link type="text/css" rel="stylesheet" href="/webapp/javax.faces.resource/css/stylesheet.css.xhtml">

and the content from the CSS, the image, tries to get it from /webapp/javax.faces.resource/css/images folder, where it can't find the image.

What I'm doing wrong?
Because importing the CSS from text.xhtml in the old way:

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

It get the image correctly.
Sorry for creating a new question, but I don't have enough reputation to comment :(

Community
  • 1
  • 1
lucasvc
  • 678
  • 1
  • 11
  • 33
  • That was a wrong suggestion. It's already been deleted from the answer. – BalusC Apr 23 '12 at 12:51
  • I guess i missed something , but if you place .css files in css folder and .png files in images folder then in css file , why wont you refer to the image as following: background-image: url('../resources/images/my_image_file.png'); – Daniel Apr 23 '12 at 14:11
  • @BalusC Sorry, I didn't see the edit and the deletion >.< But, anyway, is not a good practice then, to put background CSS images in the CSS folder? Thanks. – lucasvc Apr 24 '12 at 07:35
  • @Daniel I was refering to an old BalusC suggestion. The image was inside the CSS folder. – lucasvc Apr 24 '12 at 07:38

0 Answers0