List of usage examples for org.springframework.validation Errors getFieldErrorCount
int getFieldErrorCount();
From source file:org.jasig.portlet.cms.controller.PostValidator.java
@SuppressWarnings("unchecked") private void validatePostContent(final Post post, final Errors errors) { System.out.println(errors.getFieldErrorCount()); if (errors.getFieldValue("content") != null) { final List<String> errorList = (List<String>) getXssValidatorService().scan(post.getContent()); if (errorList != null && errorList.size() > 0) for (final String err : errorList) errors.rejectValue("content", "invalid.post.content.xss", new String[] { err }, null); }//from w ww. ja v a 2 s . c om }