X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.25a (ClamAV 0.103.12/27778) X-Junk-Score: 0 [] X-KAS-Score: 0 [] Return-Path: Received: from mail-01.1984.is ([185.112.145.69] verified) by post.selbstdenker.com (CommuniGate Pro SMTP 6.3.18) with ESMTPS id 34740776 for webobjects-dev@wocommunity.org; Wed, 08 Oct 2025 15:46:01 +0200 Received-SPF: pass receiver=post.selbstdenker.com; client-ip=185.112.145.69; envelope-from=hugi@karlmenn.is Received: from localhost by mail-01.1984.is with esmtp (Exim 4.96) (envelope-from ) id 1v6UUI-005GI1-0z for webobjects-dev@wocommunity.org; Wed, 08 Oct 2025 13:45:50 +0000 From: Hugi Thordarson Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [WO-DEV] Dynamic URL in CSS Date: Wed, 8 Oct 2025 13:45:39 +0000 References: To: WebObjects & WOnder Development In-Reply-To: Message-Id: <798F4693-50E1-407A-9C0E-83920316AFB0@karlmenn.is> X-Mailer: Apple Mail (2.3826.700.81) X-Spam-Score: 0.0 (/) X-Authenticated-User: hugi@karlmenn.is X-Sender-Address: hugi@karlmenn.is On a related note; this thread revived my interest in simplifying WO's serving of = "WebServerResources" and getting rid of the "split install", so I wrote = a ResourceManager/RequestHandler combo last weekend for serving = WebServerResources from the application. Since it's something I *really* want, I've started dogfooding, deployed = it in all of my apps and it works seemingly well. Nice to have the same = simple URLs for all resources in both dev and prod, and *very* nice not = having to worry about any web server files. It's a part of wonder-slim, = but should work fine in any Wonder app: = https://github.com/undur/wonder-slim/blob/master/ERExtensions/src/main/jav= a/er/extensions/resources/ERXResourceManagerExperimental.java Example in production (see for example; URLs for scripts and stylesheets = in the page header): https://www.neytandinn.is/ Still has a couple of outstanding issues, as seen from the FIXME/TODO = list at the top of the file. But once those are done, I'd like to = revisit another related old dream, post-processing (specifically; = templating) of webserver-resources. Did a little testing, just to see = how it would work out to process a simple string template=E2=80=A6 https://gist.github.com/hugithordarson/357f7ac603e2d9a4b69daa495d4ece11 =E2=80=A6but I think a generic solution for this could and should be = written into the application-based request handler. Hope to have time to = get to work on that during next weekend. Cheers, - hugi > On 8 Oct 2025, at 12:16, Samuel Pelletier wrote: >=20 > Hi Markus, >=20 > I have some of these in css files and it works if you use relative = urls in your css like this: >=20 > background-image: url(../img/rapportOrientation/logo/texte.svg); >=20 > The base path is the effective css file path, this exemple is expanded = to this when running in Eclipse: >=20 > = http://127.0.0.1:2324/cgi-bin/WebObjects/GCAGestion.woa/_wr_/wodata=3D/Use= rs/sam/work/KavijuWoMaven/GCARapports/src/main/webserver-resources/img/rap= portOrientation/couvertureInteractive/promoteur.jpg >=20 > In my project, webserver-resources contains css, fonts, img, js and = and scss folders. >=20 > Regards, >=20 > Samuel >=20 >=20 >> Le 1 oct. 2025 =C3=A0 08:53, Markus Ruggiero (rucotec) = a =C3=A9crit : >>=20 >> I have a large customer application that has nicely structured CSS = files. Unfortunately in one of them there are some absolute references = to WebServerResources >>=20 >> background-image: url(=E2=80=9C/MyApp/images/logo.png");=20 >>=20 >> This fails when the file is in WebServerResources. Up to now my = customer had all resources served statically from Apache. This works in = production but is not portable and breaks in Eclipse on my dev machine.=20= >>=20 >> What would be the best way to convert such CSS URLs? I cannot just = put a WOResourceURL in there or some such because the definition is in a = separate .css file in WebServerResources, not in a WOComponent. >>=20 >> How to best deal with such things? >>=20 >> Thanks for any tip and help >> ---markus--- >>=20 >>=20 >>=20 >=20