java - How to use JSR 303 @Valid annotation to validate primitive types? -
jsr 303 @valid annotation can used validate input objects controller method, demonstrated on mkyong.com
is possible use @valid annotation validate primitive types int , long[]? if so, how?
here example spring mvc method signature needs validated parameters above 0:
@requestmapping(value = { "/delete" }, method = requestmethod.post) modelandview deletebulk(@requestparam("userid") int userid, @requestparam("ids") long[] ids) {
no, can't done. it's bean validation, described here.