You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by Apache Wiki <wi...@apache.org> on 2008/01/16 10:01:19 UTC

[Myfaces Wiki] Update of "StreamingAddResource" by tchize

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by tchize:
http://wiki.apache.org/myfaces/StreamingAddResource

------------------------------------------------------------------------------
  
  Have fun!
  
+ === Caveats ===
+ There are changes in behaviour between StreamingAddResources and and the DefaultAddResource. Those are documented here
+ 
+ ==== CSS loading on head ====
+ CSS loaded at head location are loaded using an intermediate stylesheet, that "import" the files your requested. So instead of 
+ {{{
+ <head>
+     <link rel="stylesheet" href="org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12003983/component/css1.css" type="text/css"/>
+     <link rel="stylesheet" href="org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12003983/component/css2.css" type="text/css"/>
+ ....
+ }}}
+ You will get
+ {{{
+ <head>
+     <link rel="stylesheet" href="/webapp/faces/myFacesExtensionResource/org.apache.myfaces.component.html.util.StreamingResourceLoader/12003983/1566/header.css" type="text/css" />
+ }}}
+ 
+ and the header.css will contian @import() rules
+ 
+ ==== Javascript on head ====
+ 
+ If some of your componnents that absolutely requires Javascript on head (so that script get executed, for whatever reason, before <body> is reached), this component probable uses addResources.addJavaScriptAtLocation(.... AddResouces.LOCATION_HEAD ....). StreamingAddResouce will silently fallback to loading the javascript at current position instead of head. 
+