Question:
I'm using primefaces component. My problem is that it is recording the accents that the user types in the text without doing the proper HTML escaping . Is there a way to change this so he knows that the letter is an accent and needs to perform the proper HTML escape ?
Below is the code:
<p:editor id="corpoEmail" widgetVar="editorWidget" value="#{corpoEmailControl.corpoEmail}" width="700" maxlength="2000" />
Answer:
When saving the field to the database, use Apache Commons Lang's StringEscapeUtils :
import org.apache.commons.lang3.StringEscapeUtils;
// ...
String corpoEmailEscapado = StringEscapeUtils.escapeHtml4(corpoEmail);