JSR 303 @Valid annotation can be used to validate input objects to a controller method, as demonstrated on Mkyong.com
Is it possible to use @Valid annotation to validate primitive types like int and long[]? If so, how?
Here is an example Spring MVC method signature that needs to be validated that the parameters are above 0:
@RequestMapping(value = { "/delete" }, method = RequestMethod.POST)
ModelAndView deleteBulk(@RequestParam("userId") int userId, @RequestParam("ids") long[] ids) {
long[]
is not a primitive type – SJuan76