Re: CSS resources using url(...) syntax under Direct Connect
Re: CSS resources using url(...) syntax under Direct Connect
- Subject: Re: CSS resources using url(...) syntax under Direct Connect
- From: John Huss <email@hidden>
- Date: Tue, 31 May 2011 09:09:13 -0500
Relative URLS work fine, but you must use an external CSS file, not a style tag embedded in a component. The URL is resolved relative to the location of the hosting file.
John
On Mon, May 30, 2011 at 4:35 AM, Paul Hoadley
<email@hidden> wrote:
Hi Frank,
On 30/05/2011, at 6:22 PM, Ruenagel, Frank wrote:
> I guess, this is a problem of resource-path-names without beginning with "/" or "http://".
> For example the following *never* may come up in the generated html of a WO-generated dynamic page:
>
> <style>
> div#statistic p#count-right{
> background-image: url(images/count-right.jpg);
> }
> </style>
You are right, that doesn't work.
> There has to be "/images..." (or alternative the absolute path),
> else the URL is interpreted as relative to the current "page", which is
> a WOComponent or DirectAction.
As far as I can tell, that doesn't work either. Using the url(...) notation within a page seems to generate filesystem paths relative to '/Library/WebServer/Documents/', regardless of whether they're relative or absolute. I've just tested both, running within Eclipse.
Anyway, that's not what we're trying to do. We're using the url(...) notation not within a page template, but from within a stand-alone CSS resource which has already been loaded. In that case, relative paths within the CSS file should be relative to the location of the file itself. Indeed, it works just fine in both Eclipse and in normal deployment running under JavaMonitor. In any case, I tried converting the image references to "absolute" (relative to WebServerResources, I suppose), and it still doesn't work under Direct Connect.
> Check the *generated* page for such errors.
The weird part is that Safari doesn't complain about missing resources. It thinks it has them. They're just empty.
> Check the logs of your app: any miraculous "page not found" errors around?
The only time the app logs show an error is when I change "../img/foo.png" to "/img/foo.png" and it complains that it's not present in '/Library/WebServer/Documents/'.
--
Paul.
http://logicsquad.net/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (
email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to
email@hidden