Hi,
It's possible with Bean Validation to validate the content of any sub-type of Iterable by adding the @Valid annotation like you've done. In this case, the BV algorithm is then applied on each element (validation of the element constraints).
In your case the String class has no constraints. The @Pattern constraint you've added is applied to the Collection and not on each element of it. That's why you have this error message because the @Pattern constraint cannot be applied on a Collection.
Some ways to solve your problem:
- create a custom constraint [1]
- create a validator implementation for @Pattern (See BV spec 7.1.2) [2]
Hope this help!
[1]
http://docs.jboss.org/hibernate/validat ... onstraints[2]
http://jcp.org/aboutJava/communityproce ... index.htmlBTW, please use
viewforum.php?f=9 for questions related to Hibernate Validator.
--Kevin