webtier@glassfish.java.net

404 on image referenced by css file included in the page

From: <webtier_at_javadesktop.org>
Date: Wed, 24 Mar 2010 11:26:36 PDT

I have a page that references images directly and some that are referenced by an included css. Using the new resourcing for 2.0, I am able to display the images directly. An example of this can be seen below.


                <ice:graphicImage
                    url="../#{resource['css-images:arrow-next.gif']}"
                    style="border:none;"
                    title="Next Page"/>

The URL generated in the browser looks like this.

http://localhost:8080//IceFacesTestApp2/javax.faces.resource/arrow-next.gif.jsf?ln=css-images

That is working fine. However, when I have an image referenced by the included css file, it is not found.

This is an example of such a reference taken from my css file.
.iceCmdSrtHdrAsc{
    background-image: url('./css-images/column_sort_asc.gif');
}

Using firebug, I can see that it is generating this URL
http://localhost:8080//IceFacesTestApp2/javax.faces.resource/css-images/column_sort_asc.gif

If I directly type the following into the browser, I can see the image

http://localhost:8080//IceFacesTestApp2/javax.faces.resource/column_sort_asc.gif.jsf?ln=css-images

How can I change things so that this image if found properly? It is worth mentioning that the resources are packaged into a separate jar that is bundled into my application. The resources are all found under the META-INF/resources directory. The images are found in a subdirectory called css-images

The css is referenced as followed in the head of the page.
        <link rel='stylesheet' type='text/css' href="../#{resource['style.css']}"/>
        <h:outputStylesheet name="style.css"/>
[Message sent by forum member 'tracker09']

http://forums.java.net/jive/thread.jspa?messageID=393540