• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Working with component tree before render

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I need move all JS scripts from tag HEAD to bottom of tag BODY to increase a loading speed of application. How to do this? I trying solve this using PhaseListener, but can't understand how working with component tree from this scope.
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A lot of the renderers in JSF specifically and explicitly indicate what part of the generated HTML they will be output in, whether HEAD, body-start, body-end, or wherever. If you attempt to blindly override them you will probably not like the results.

The best way to increase the loading speed is to keep the content short, which doesn't require any messing around with JSF internals at all. In the case of user-requested JavaScript, making the scripts externally URL-referenced instead of in-line may help.

For some frameworks such as RichFaces, the server synthesises a client-specific script and uses the same script as an external URL reference for all of the client's RichFaces pages. So ensuring that this script is cached on the client can be a major performance boost. This isn't as easy as it seems, however, since some webapp servers such as Tomcat disable caching for secured items and have to be persuaded to re-enable caching.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic