How to insert special characters like &
and <
into JSF components value
attribute ?
For example: I want something like this:
<h:outputText value="Tom & Jerry Show" />
When I try this, I get the following exception:
javax.faces.view.facelets.FaceletException: Error Parsing /foo.xhtml: Error Traced[line: 15] The entity name must immediately follow the '&' in the entity reference.
And in case of <
, I get the following exception:
javax.faces.view.facelets.FaceletException: Error Parsing /foo.xhtml: Error Traced[line: 15] The value of attribute "value" associated with an element type "h:outputText" must not contain the '<' character.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…