#{resource['images:xxx.jpg']} cannot work in CSS

Splash Forums SocialPM Users #{resource['images:xxx.jpg']} cannot work in CSS


This topic contains 1 reply, has 2 voices, and was last updated by  Lincoln Baxter III 10 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #18086


    Hi, all,

    I use JSF2 to implement a website, found the following css(ui.css) cannot display the image :

    body {

    font: 12px/20px Arial, Verdana, Lucida, Helvetica, simsun, sans-serif;

    background:url(#{resource}) no-repeat;

    // background:url(‘#{request.contextPath}/resources/images/livesino_bg.jpg’) no-repeat; it cannot work too.


    I try to put the image to the folder same as ui.css and in the folder sources/images/. both not work.

    but if the style is in <body> element:

    <h:body style=”background:url(#{resource}) no-repeat;”>

    image display.

    But I found socialpm-web also use the first way (application.css):

    #masthead div.inner,#footer div.inner {

    background: transparent url(#{resource}) top center ;

    padding: 45px 0;

    -webkit-box-shadow: inset 0 10px 30px rgba (0, 0, 0, 0.3 );

    -moz-box-shadow: inset 0 10px 30px rgba (0, 0, 0, 0.3 );

    box-shadow: inset 0 10px 30px rgba (0, 0, 0, 0.3 );


    is it invalid to use #{resource} and #{request.contextPath} in css file?

    or do I miss something?

    thx for your help.



    This isn’t really a question about PrettyFaces, but I think you want to use something like this:


    Also, your images need to be in the webapp/resources/ folder.

    Hope this helps,


Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘SocialPM Users’ is closed to new topics and replies.

Comments are closed.