Facelets currently trims whitespace in literal text. As a result, if two JSF
components are separated by only whitespace, that whitespace is removed and the
two components bump up next to one another. The well-documented workaround is to
insert an EL value expression that resolves to a space to trick Facelets into
adding a space between components. This is a ridiculous hack and there is
absolutely no reason this whitespace should be trimmed. I would like to propose
that Facelets change its trimming policy. If necessary, you can add a legacy
flag to retain the old behavior (but I don't think it's necessary).
Here's the common workaround to produce JavaServer Faces:
Another workaround is to use a non-breaking space (i.e., #&160;), but this is
even more of a hack (and semantically wrong).
This issue can be solved by removing all the logic from the private method