How can I validate the string length using java spring validation?
You can just use the “@Size”-annotation twice: @Size(min = 2, message = “{validation.name.size.too_short}”) @Size(max = 200, message = “{validation.name.size.too_long}”) private String name;