This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes image URLs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "image URLs" Watch "image URLs" New topic

image URLs

David Sheltby
Ranch Hand

Joined: Oct 19, 2011
Posts: 34

I have the following directory structure:


The template has the following <hutputStylesheet library="css" name="theme.css" /> in the <h:head> tag, however none of the images defined in theme.css are loading. All the URL paths are relative (e.g. they start with "images/"). The only way I can get them to load is to make them absolute URL's. What should they be?

Vladimir Mokrozub

Joined: Aug 31, 2012
Posts: 12
Try this:
David Sheltby
Ranch Hand

Joined: Oct 19, 2011
Posts: 34
That works, except its not pretty. I also go it to work by changing them to:
Not really sure why that works though.

I agree. Here's the link:
subject: image URLs
Similar Threads
2 different url but link to the same page
JSP cannot load the CSS, help!!
Accessing external resources
Adjusting location of images in a CSS file using url() ?
how to set different dir to resource bundle file