i'm trying to do a validation of only positive numbers inside the request in spring boot
Public ResponseEntity getId(@RequestParam(value =“idPer”)@Pattern(regexp=“^[0-9]*$”),message = “the value is negative”)
@NotNull(message = “the value is empty ”) Long idPer){
}
in my exceptionhandler I get this exception
no validator could be found for constraint 'javax.validation.constraints.pattern' validatingtype long
I have the @validated above my controller class
what am I doing wrong?