You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Ganesh <ga...@j4fry.org> on 2009/04/30 22:05:16 UTC

h:head and h:body in JSF 2.0 and javax.faces.ViewRoot

Hi,

Here's the same message again as it received no reply, that /dev/null 
guy has become busy again. Martin, would you consider bringing this into 
jsr-314-open if on jsr-314-comments it doesn't receive an answer?

Best Regards,
Ganesh

3 more comments from Apache MyFaces development on the JSR 314 spec:

[1] In the spec 2.6.2.1 h:head and h:body are silently indroduced as the
JSF 2.0 way of rendering html head and body. It says >>The <h:head> and
<h:body> tags refer to the renderers HeadRenderer and BodyRenderer
respectively, described in Section 8.6 "Standard HTML RenderKit
Implementation".<<, but there the new renderers aren't mentioned at all.
Can you please insert a phrase or two on the usage of h:head and h:body?

[2] The jsdoc on javax.faces.response defines a behaviour for update
elements with the id javax.faces.ViewRoot. By testing with the RI I
found out that this behaviour is triggered if an AJAX requests triggers
a naviagtion rule that leads to a different page. It's a cool thing to
have a well defined behaviour in this case, but the spec doesn't define
it. It's just what Mojarra does. Can you please add a paragraph that
defines the circumstances under which the server has to respond with
javax.faces.ViewRoot?

[3] In the javax.faces.ViewRoot case Mojarra returns a complete document
with DOCTYPE, html, head and body. It is left to the Javascript
implementation to separate these and replace the head and body sections.
This is a tedious task involving a parser that deals with html comments,
Javascript comments and CDATA sections within the HTML page. The
Javascript code Mojarra brings for this is unsufficient and fails for
many cases. We are currently working on a parser. Things would be a lot
easier if the spec would force the server to return separate CDATA
blocks within javax.faces.ViewRoot for the head and the body tag and to
omit the html tag and the DOCROOT. This can't be too hard to implement,
because head and body are rendered by h:head and h:body. Can you please
define the format for javax.faces.ViewRoot to contain 2 CDATA sections,
1 optional with the head tag and 1 required with the body tag?

Best Regards,
Ganesh Jung



Re: h:head and h:body in JSF 2.0 and javax.faces.ViewRoot

Posted by Werner Punz <we...@gmail.com>.
Ok to finish this task now.
As it seems we probably need a small parsing step anyway
After all we can only replace everything within the html tags.
A full viewRoot rendering probably will default to

...
<![CDATA[
<html ..>
    Then the entire html code
</html>
]]>

Am I right, I need here more insight since I did not work on that
level on the java side. Simon you might know more about it?
Do we render the outer html tags as well or in case of a ppr viewroot 
update do we render just the plain content omitting <html />?

So what we have to do is to strip code out of the html tags
and to replace our entire content with the new code? This should not
impact performance!

Anyway, I have modified my mini parser to exactly deal with this
and still be able to handle comments doc definitions outside of the html 
area.
I will commit it tomorrow. If we dont need it we still can drop it
by commenting out one line!



Re: h:head and h:body in JSF 2.0 and javax.faces.ViewRoot

Posted by Werner Punz <we...@gmail.com>.
Roger Kitain schrieb:
> Hi Ganesh-
> 
> I'll take a look at this...  that dev/null guy was on vacation ;-)

I thought he quit his job, and works now at the Microsoft support?
  ;-)


Werner


Re: h:head and h:body in JSF 2.0 and javax.faces.ViewRoot

Posted by Roger Kitain <Ro...@Sun.COM>.
Hi Ganesh-

I'll take a look at this...  that dev/null guy was on vacation ;-)
BTW - I did file a spec issue: 
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=552

Thanks, Roger.
Ganesh wrote:
> Hi,
>
> Here's the same message again as it received no reply, that /dev/null 
> guy has become busy again. Martin, would you consider bringing this 
> into jsr-314-open if on jsr-314-comments it doesn't receive an answer?
>
> Best Regards,
> Ganesh
>
> 3 more comments from Apache MyFaces development on the JSR 314 spec:
>
> [1] In the spec 2.6.2.1 h:head and h:body are silently indroduced as the
> JSF 2.0 way of rendering html head and body. It says >>The <h:head> and
> <h:body> tags refer to the renderers HeadRenderer and BodyRenderer
> respectively, described in Section 8.6 "Standard HTML RenderKit
> Implementation".<<, but there the new renderers aren't mentioned at all.
> Can you please insert a phrase or two on the usage of h:head and h:body?
>
> [2] The jsdoc on javax.faces.response defines a behaviour for update
> elements with the id javax.faces.ViewRoot. By testing with the RI I
> found out that this behaviour is triggered if an AJAX requests triggers
> a naviagtion rule that leads to a different page. It's a cool thing to
> have a well defined behaviour in this case, but the spec doesn't define
> it. It's just what Mojarra does. Can you please add a paragraph that
> defines the circumstances under which the server has to respond with
> javax.faces.ViewRoot?
>
> [3] In the javax.faces.ViewRoot case Mojarra returns a complete document
> with DOCTYPE, html, head and body. It is left to the Javascript
> implementation to separate these and replace the head and body sections.
> This is a tedious task involving a parser that deals with html comments,
> Javascript comments and CDATA sections within the HTML page. The
> Javascript code Mojarra brings for this is unsufficient and fails for
> many cases. We are currently working on a parser. Things would be a lot
> easier if the spec would force the server to return separate CDATA
> blocks within javax.faces.ViewRoot for the head and the body tag and to
> omit the html tag and the DOCROOT. This can't be too hard to implement,
> because head and body are rendered by h:head and h:body. Can you please
> define the format for javax.faces.ViewRoot to contain 2 CDATA sections,
> 1 optional with the head tag and 1 required with the body tag?
>
> Best Regards,
> Ganesh Jung
>
>