@Override
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {
if (value != null) {
if (!Jsoup.isValid(value.toString(), whitelist)) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_WARN, "message contains unsafe character sequence", "");
throw new ValidatorException(message);
}
}
}