Sylvain Vieujot wrote:
By default, HTMLEncoder.encode( txt ) doesn't encode \n to <br/>. So, <h:outputText> doesn't encode the new lines either.
Is this expected ?
My guess would be that by default, the new lines should be encoded.
Sylvain,
to not encode newline characters is expected behaviour, the spec does not require h:outputText to encode newlines. There is only the requirement that
"characters that are sensitive in HTML and XML markup must be escaped"
when the encode flag is set to true (which is the default). So if you need <br /> for newlines in your text you have to do it on your own (and don't forget to set encode="false" for the h:outputText in this case otherwise the <br/>s will end up on the user's screen).
Oliver
Sylvain.
-- Oliver Rossmueller Software Engineer and IT-Consultant Hamburg, Germany http://www.rossmueller.com
