0

I got this in my css file:

background: #1484e6 url("/webapp/javax.faces.resource/images/ui-bg_diagonals-thick_22_1484e6_40x40.png.xhtml?ln=primefaces-excite-bike") 50% 50% repeat;

How would I reference to the image instead of using this full url? Because the basename "webapp" could change, so this will not always work.

I tried using this, but it won't work:

#{resource['images:ui-bg_diagonals-thick_22_1484e6_40x40.png']}
Wesley Egbertsen
  • 720
  • 1
  • 8
  • 25

1 Answers1

2

You used the wrong library name. The part before : in the resource identifier represents the library name. You specified images, while it should be primefaces-excite-bike as indicated by the ln request parameter in the URL.

So, this should do:

#{resource['primefaces-excite-bike:images/ui-bg_diagonals-thick_22_1484e6_40x40.png']}

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555