JSF - <h:outputText> (escape special chars)

允我心安 提交于 2019-12-30 11:36:11

问题


I am trying set 1®2 in outputText:

<h:outputText value="1&lt;sup&gt;&#174;&lt;sup/&gt;2" escape="false"/>

What is incorrect? I get 2 in uppercase.


回答1:


You can choose one of the following

In your original proposal you had a misplace the / it should be before the sup

<h:outputText value="1&lt;sup&gt;&#174;&lt;/sup&gt;2" escape="false"/>

You can also remove the sup completely (but than your (R) wont be small)

<h:outputText value="1&#174;2" escape="false"/>

Finally you can use it directly without escaping

<h:outputText value="1®2"/>


来源:https://stackoverflow.com/questions/14374758/jsf-houtputtext-escape-special-chars

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!