1

I want to add HTML <sup>&#174;</sup> (which is ®) to <h:outputText>, but I get exception.

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

What is incorrect?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Jffs2ej
  • 109
  • 2
  • 3
  • 11

2 Answers2

3

You don't need <h:outputText> at all. You can just write down HTML plain vanilla in a JSF page.

E.g.

<p>#{bean.productName}<sup>&#174;</sup></p>

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
2

You can't use < an > signs in xhtml code. Shouldn't your value be something like this:

<h:outputText value="&lt;sup&gt;&#174;&lt;sup/&gt;" escape="false"/>
partlov
  • 13,789
  • 6
  • 63
  • 82