JSF-< h:outputText> (转义特殊字符) [英] JSF - <h:outputText> (escape special chars)

查看:177
本文介绍了JSF-< h:outputText> (转义特殊字符)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在outputText中设置1 ® 2:

I am trying set 1®2 in outputText:

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

什么是不正确的?我得到大写的2.

What is incorrect? I get 2 in uppercase.

推荐答案

您可以选择以下选项之一

You can choose one of the following

在原始提案中,您将/放错了位置,将其放置在sup

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"/>

您也可以完全删除sup(但是,您的(R)不会很小)

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"/>

这篇关于JSF-&lt; h:outputText&gt; (转义特殊字符)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆