开发者

Whitespaces in String escaped even with <h:outputText escape="false"

开发者 https://www.devze.com 2023-04-05 20:57 出处:网络
In the database and when i make java output the tex开发者_Python百科t in the getText() method, the text is with normal whitespaces but when the .xhtml is doing the output all whitespaces are transform

In the database and when i make java output the tex开发者_Python百科t in the getText() method, the text is with normal whitespaces but when the .xhtml is doing the output all whitespaces are transformed to &nbsp; i tried it without h:outputText and with escape false/true.

<h:outputText escape="false" value="#{itemHome.description.text}" />

Any suggestions?

Thanks


JSF/Facelets does not do that, but some browsers/plugins (Firebug "Inspect Element" for example will do, but not Firefox View Source!) will show that when those spaces are actually non-breaking spaces (U+00A0) instead of normal spaces (U+0020). The problem needs to be fixed on the DB side (or on the input validation/conversion side whenever it concerns user-controlled input).

0

精彩评论

暂无评论...
验证码 换一张
取 消