protected void validate(Object o) {
ArrayList<SampleError> errors = new ArrayList<SampleError>();
for (ConstraintViolation<Object> violation : globalValidator.validate(o)) {
errors.add(new ValidationError(violation.getLeafBean().getClass()
.getSimpleName(), violation.getPropertyPath().toString(),
violation.getInvalidValue().toString(), violation
.getRootBeanClass().getSimpleName()));
}
if (!errors.isEmpty()) {