Recently I was transferred to a new project where I got an assignment to do some JSF stuff. After I checked in my code, I got a furious message from the project leader who told me HTML tags don't belong in JSF (when using it in a JSP file).
I'm not talking about making complex layouts by abusing tables, but just some rather innocent br tags between the JSF tags, e.g:
According to him, my JSF tree isn't 100% components anymore and styling should only be done through CSS in which br tags (among others) don't have any place. Now I'm rather confused. He sounds pretty convincing, but actually I don't see a lot of evidence on the net that shares this opinion. To the contrary, spec lead Ed Burns even uses the HTML table tag in his own examples and many textbooks use HTML mixed with JSF tags as well.
So I wonder how people out here think about this...
As an emergency help - put <f:verbatim></f:verbatim> around your non-jsf content. I.e. something like <f:verbatim><br></f:verbatim>
To the contrary, spec lead Ed Burns even uses the HTML table tag in his own examples and many textbooks use HTML mixed with JSF tags as well.
We are speaking about JSF 1.1 and below at this point: Most JSF tags do not allow non-jsf content inside (and without f:verbatim around). If you put the non-content inside, it will be pushed out. This happens because of the way show the component tree is rendered. There are three tags that still allow non-jsf content. Those are f:view f:form f:subview. If you looks closely to the examples where html tags are used you can find that there are no tags such as h anelGrid around.
JSF 1.2 addresses this problem. The way how the component tree is rendered has been changed there. At the same time, Facelets helps to work in mixed content even inside the JSF 1.1 environment.