0

Any idea why validation isn't occurring? I'm expecting it to get picked up by my @ControllerAdvice mapping, but the code in the controller is just getting executed as no validation is occurring.

@RequestMapping(value = "/endpoint", method = RequestMethod.GET)
public MyResponse searchSomething(@Validated 
                                  @NotNull 
                                  @Size(min=2) 
                                  @RequestParam("lastName") String lastName) { ... }

@ExceptionHandler(ConstraintViolationException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ResponseBody
public ErrorResponse processConstraintViolationExceptionError() { ... }
Josh
  • 371
  • 1
  • 4
  • 12

0 Answers0