title: Using JSR-303 validator instead of Spring Validator
body: <p>I have a very naive conceptual question here for clarification. In my app I'm currently using JSR 303 Hibernate Validator for validating the domain model with @NotBlank and @NotNull annotations, like checking username, password etc. </p>
  
  <pre><code>public class Admin {
  
    private Long id;
    @NotBlank(message = "Username should not be null")
    private String username;
    @NotBlank(message = "Username should not be null")
    private String password;
    ...
  </code></pre>
  
  <p>But for validating the domain logic like existing username, I'm still using Spring's Validator interface</p>
  
  <pre><code>@Component
  public class AdminValidator implements Validator {
    ...
    @Override
    public void validate(Object target, Errors errors) {
      Admin admin = (Admin) target;
      if (usernameAlradyExist())){
          errors.rejectValue("username", null, "This user already exist's in the system.");
      }
  
  }
  </code></pre>
  
  <p>In the controller I'm using both </p>
  
  <pre><code>@RequestMapping(value = "/register", method = RequestMethod.POST)
  public String register(@Valid @ModelAttribute("admin") Admin admin, BindingResult bindingResult,) {
      validator.validate(admin, bindingResult);
      if (bindingResult.hasErrors()) {
          return REGISTER_ADMIN.getViewName();
  
      }
  </code></pre>
  
  <p>Is it possible just to use Hibernate Validator and not at all use Spring Validator for validating domain logic?</p>