webtier@glassfish.java.net

Re: [webtier] <h:outputScript/> output order seems reversed

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Thu, 12 Mar 2009 09:44:44 -0700

On 3/11/09 10:00 PM, Derek wrote:
> When using <h:outputScript />, the order that scripts are put out seem
> to be reversed to the order they are listed in jspx.
>
> <h:outputScript name="ocpcommon/jquery-1.2.3.min.js" target="head" />
> <h:outputScript name="ocpcommon/jquery.tablesorter.js" target="head" />
>
> Will result in:
>
> <script src="/ocpsoft-social-pm/javax.faces.resource/ocpcommon/jquery.tablesorter.js.xhtml" type="text/javascript"></script>
> <script src="/ocpsoft-social-pm/javax.faces.resource/ocpcommon/jquery-1.2.3.min.js.xhtml" type="text/javascript"></script>
>
> Which causes a JS error because of tablesorter's dependency on jquery.
>
> Is this the intended behavior of h:outputScript? Reversing the order
> solves the order issue it seems. I'm not sure if that is a fluke or
> intended behavior
>
Strange. The scripts for the different targets are stored in a list and
rendered in the order added.
If you can create a test case that demonstrates this, please log an
issue [1] and attach it and we'll
take a look.

[1] https://javaserverfaces.dev.java.net/issues/
>
>
> --
> Derek Hollis