0

How to add that patter to a string array

@Data
public class AccountRoles {

private String itCode;

@Pattern(regexp = "[a-zA-Z0-9 ]")
@NotEmpty
private String[] rolesAdded;

@Pattern(regexp = "[a-zA-Z0-9 ]")
private String[] rolesRemoved; 

Exception : **HV000030: No validator could be found for constraint 'javax.validation.constraints.Pattern' validating type 'class java.lang.String[]'. Check configuration for 'rolesAdded' **

David Osborne
  • 6,215
  • 1
  • 21
  • 33
Ramanuj
  • 113
  • 11
  • 1
    [This](https://stackoverflow.com/questions/32069126/validate-elements-of-a-string-array-with-java-bean-validation) post might help you on the question. – Nagaraju Chitimilla Jun 24 '21 at 11:38

0 Answers0