webtier@glassfish.java.net

Why does JSF 2.0 facelets eat spaces the way it does?

From: <webtier_at_javadesktop.org>
Date: Thu, 16 Jul 2009 15:05:11 PDT

I have a simple demo like this:

            The current date and time in
            <h:outputText value="#{timeZoneBean.city}"/>
            is
            <h:outputText value="#{timeZoneBean.time}"/>

Unfortunately, the output is

The current date and time inRome is9:30AM.

Note that there is no space after in and is.

Why is it that the h:outputText tag swallows ALL preceding space but not the space that follows it? I know I can add &#160; to avoid this (or just add spaces inside the value attributes). I just want to know the rationale why Mojarra is so beastly. I mean, couldn't it have replaced all that white space with one space? There seems nothing in the standard to mandate the current behavior.

Thanks,

Cay
[Message sent by forum member 'cayhorstmann' (cayhorstmann)]

http://forums.java.net/jive/thread.jspa?messageID=356124