webtier@glassfish.java.net

Re: [webtier] [JSF 2.0]: outputStyleSheet reordering stylesheet

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Wed, 08 Jul 2009 23:45:03 -0700

I can't speak to the ordering issue. But I can tell you that we fixed a
bug very recently where outputStylesheet was sometimes (often actually)
not behaving correctly, where rendering into the <head> was concerned
(this bug may have also effected order, not sure).

Please try the latest nightly build, and see if it fixes your issue. If
it doesn't, then I agree this is a bug, and you should file it. But
hopefully, this bug is already fixed. Thanks!

Jim

On 7/8/09 11:15 PM, webtier_at_javadesktop.org wrote:
> A facelets based view is using the outputStylesheet element to render links to CSS. It seems that the resource management is re-ordering the links. I would expect that they are output in the same order as they were placed in the xhtml file.
> Linking to CSS this way does not result in the proper HTML rendered.
>
> <h:head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> <title>Composite oocss module</title>
>
> <h:outputStylesheet library="oocss.blocks" media="all" name="css/libraries.css" target="head" />
> <h:outputStylesheet library="oocss.blocks" name="css/template.css" target="head" />
> <h:outputStylesheet library="oocss.blocks" name="css/grids.css" target="head" />
> <h:outputStylesheet library="oocss.blocks" name="css/content.css" target="head" />
> <h:outputStylesheet library="oocss.blocks" name="css/mod.css" target="head" />
> <h:outputStylesheet library="oocss.blocks" name="css/mod_skins.css" target="head" />
> </h:head>
>
> Switching to"regular" HTML link elements gives me a better result
> e.g.:
> <link rel="stylesheet" type="text/css" media="all"
> href="#{facesContext.externalContext.requestContextPath}/resources/oocss.blocks/0_2/css/libraries.css" />
>
> Dont' know if it is just the ordering causing my problems but I find it strange that the stuff gets rearranged! (Wouldn't this lead to problems where CSS rules may override existing rules by applying some defined CSS loading order?
>
> Next I tried to move the CSS to a composite implementation which messed things up totally!
>
> <composite:implementation>
> <h:outputStylesheet library="oocss.blocks" name="css/libraries.css" target="head"/>
> <h:outputStylesheet library="oocss.blocks" name="css/template.css" target="head"/>
> <h:outputStylesheet library="oocss.blocks" name="css/grids.css" target="head"/>
> <h:outputStylesheet library="oocss.blocks" name="css/content.css" target="head"/>
> <h:outputStylesheet library="oocss.blocks" name="css/mod.css" target="head"/>
> <h:outputStylesheet library="oocss.blocks" name="css/mod_skins.css" target="head" />
>
> This Some CSS is going to the body while other is going to the head as set by the target attribute.
> A bug that I should be reporting or just doing something wrong?
> [Message sent by forum member 'mahrer' (mahrer)]
>
> http://forums.java.net/jive/thread.jspa?messageID=354833
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>