How to validate user's input within a number range in Spring MVC?

In Spring MVC Validation, we can validate the user's input within a number range by using the following annotations :

* @Min annotation : It is required to pass an integer value with @Min annotation. The user input must be equal to or greater than this value.

* @Max annotation : It is required to pass an integer value with @Max annotation. The user input must be equal to or smaller than this value.