Originally posted by Alex Horst:
Is it possible to access the <body> element from a managed bean?
I want to add the "onLoad" attribute programmatically.
The statement above returns null. I guess this is because the ViewRoot contains JSF-Components only?
Thanks in advance.
In short yes. If you want to have access to the 'head' then you need a head component. It would be simple to write one, though component libraries such as woodstock  have a head component.
Additionally, JSF 2.0, there will be a basic head component included.