Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Dealing with application names in a JEE web app Date: Wed, 25 May 2011 12:16:32 -0700 Organization: A noiseless patient Spider Lines: 49 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 25 May 2011 19:16:43 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="8FmyTa30jaHydmbsw/NXBQ"; logging-data="24987"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181nHEHK6xnQ8i80J9g5Wj/2Ij5w3sCSw0=" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: Cancel-Lock: sha1:H2A85zkrzv9zFAzMDaGq//pFsIg= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4580 On 5/24/2011 10:16 AM, Tom Anderson wrote: > > It doesn't help you deal with this in resources which are not > programmatic, like static CSS, so here you have to depend on relative > references. This doesn't strike me as difficult - you decide early on to > keep all your css under /contextpath/css, and your site furniture images > under /contextpath/images, and then because CSS image paths are relative > to the stylesheet, in your CSS you can write: > > background:url(../images/bbg.jpg) left top repeat; Thanks for replying Tom, but this doesn't appear to be quite correct. According to some sources on the 'net, you CAN put EL expressions in static CSS resources: background:url("#{resource['sunny:images/header.png']}") This works because apparently when you load with a Faces tag like h:outputStylesheet, it emits HTML that loads the static resource through the Faces servlet. For example, this: renders as this: where "solicitacoes" is apparently the web context root. I really appreciated you guys trying to help me out, but I'm really frustrated at the lack of a single, authoritative source where all this is spelled out. I looked in the JSF 2.1 spec and it barely even mentions h:outputStylesheet, and certainly doesn't discuss its tags or parameters anywhere that I could find.