I want to test inputText field to see if its content matches anything but at least one & (ampersand).
When I test &
or &
or \&
inside pattern field of validateRegex, I always received this error :
javax.faces.view.facelets.FaceletException: Error Parsing /index.xhtml: Error Traced[line: 71] Le nom de l'identité doit immédiatement suivre le caractère "&" dans la référence d'entité.
and I get 500 error...
How can I escape this character?
Update
I have tested
<p:inputText id="player_name_register" value="#{login.name}">
<f:validateRegex pattern="[&]{3, 50}" />
</p:inputText>
But when I test with &&&&&&
it doesn't work.
I also tested
<![CDATA[
<p:inputText id="player_name_register" value="#{login.name}">
<f:validateRegex pattern="[&]{3, 50}" />
</p:inputText>
]]>
but my inputText doesn't appear anymore.
See Question&Answers more detail:os