title: Spring MVC Validation error message
body: <p>I have a problem with the validation in spring MVC. If I send an invalid request for the body, the application returns to the bad request but not my custom message.</p>
  
  <p>The code is :</p>
  
  <pre><code>public @ResponseBody ResponseEntity&lt;BaseModel&gt; newTicket(@Valid @RequestBody Ticket ticket, Locale locale, BindingResult bindingResult ){
      if(bindingResult.hasErrors()) {
          logger.info("error");
          throw new BadRequestException("Bad Request");
      }
  </code></pre>
  
  <p>if I try to put the application in debug mode, the if is never executed.</p>
  
  <p>Can someone help me?</p>