I've tryed to find in the spec how a JSF component should handle its children if those are HTML tags or plain text instead of JSF components but I couldn't really find anything. So please, if I've miss it, just indicate me the chapter number.
So I've make some tests and it appears that Mojarra is always wrapping those kind of child inside a UIInstructions (which is implementation specific). Shouldn't a standard way should be specify to let people know how to handle with non JSF content inside a JSF component? So every JSF implementation use the same mechanism.
In the same topic, I'm fine when plain text is nested inside a UIInstructions, but a bit sad when several HTML tags are nested inside only one UIInstructions. Why? Because I can no longer easily use both JSF components and HTML tags at the same time. For example, let's say I have a dropdown menu that will wrap each of its child inside a <li> tag when rendered.
Should generated, by iterating over the children, something like:
But what if I use HTML tags directly now?
The generated code will be:
Why is that? Because the two HTML tags are wrapped inside only one UIInstructions, so for the parent JSF component, both of them are only one child, and so they are both nested inside only one <li> tag.
You could say that I could have used <h:outputLink> but that's not the point here. There is lots of HTML tags that just don't have a JSF equivalent, even more since HTML5, and those tags are not greatly handle when it comes to tree hierarchy IMO. Since the goal of JSF is to generate HTML, it should be able to plug with HTML natively.
What about creating a JSF component like "UIHtmlTag" that would wrap any HTML tag found? So, in the previous example, instead of having only one UIInstructions, you would have two UIHtmlTag, far better for child rendering purpose. UIInstructions would be use for plain text only. What do you think?