I have tried a number of examples from the net and cannot get Spring to validate my query string parameter. It doesn\'t seem execute the REGEX / fail.
packag
You can try this
@Pattern(regexp="^[0-9]+(,[0-9]+)*$")
private static final String VALIDATION_REGEX;
(pay attention for the final modifier) or else
@Pattern()
private static final String VALIDATION_REGEX = "^[0-9]+(,[0-9]+)*$";
And then remove @Pattern(regexp = VALIDATION_REGEX) from your method and keep only the @Valid annotation:
public myResonseObject getMyParams(@PathVariable("id") String id, @Valid @RequestParam(value = "myparam", required = true) String myParam) {