webtier@glassfish.java.net

Re: [webtier] Why does JSF 2.0 facelets eat spaces the way it does?

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Fri, 17 Jul 2009 14:10:30 -0700

Cay -

Since your issue is related to spaces surrounding components, I thought
it worthwhile to mention that the following code produces the correct
behavior, as a workaround:

Change:

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

To simply be:

The current date and time in #{timeZoneBean.city} is #{timeZoneBean.time}


Remember, outputText is only needed for certain limited cases in
facelets - you can otherwise directly inject bean values directly into a
page.

Jim

On 7/16/09 9:42 PM, webtier_at_javadesktop.org wrote:
> Thanks Ed and Jim--this has been very helpful to understand the issues involved. I can see that turning whitespace into a component is going to wreak havoc with h:panelGrid and such. But in this case, all that would need to be done is to add one (or all) white space character to the preceding component that holds the static text.
>
> Like I said, I couldn't find anything in the spec that mandated one kind of behavior or another, so I am hopeful that this can be solved with some ingenuity in the RI.
>
> Thanks,
>
> Cay
> [Message sent by forum member 'cayhorstmann' (cayhorstmann)]
>
> http://forums.java.net/jive/thread.jspa?messageID=356169
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>