title: Validate basic types (String, Integer, ...) parameters on Spring Controller
body: <p>I've found a lot of tutorials and documentation about the input validation using Spring (<a href="https://spring.io/guides/gs/validating-form-input/" rel="noreferrer">https://spring.io/guides/gs/validating-form-input/</a>) and exploiting JSR 303. But all these documentations are about how validate a custom bean (like User, Employer, or classes like that). 
  I actually need to validate a controller accepting basic types like String, Integer and Lists. My API controller looks like</p>
  
  <pre><code>@Override
  @RequestMapping(value="/v1/{var:.*}/resource", method = RequestMethod.GET)
  public ResponseEntity&lt;Response&gt; readDocuments(
          @PathVariable(value = "var") String param1,
          @RequestParam(value = "param2", required = false, defaultValue = "string1") String param2,
          @RequestParam(value = "param3") List&lt;String&gt; param3,
          @RequestParam(value = "param4", required = false) Integer param4)
      { 
          // do something
      } 
  </code></pre>
  
  <p>I want to define some constraints on parameters, something like </p>
  
  <pre><code>@Override
  @RequestMapping(value="/v1/{var:.*}/resource", method = RequestMethod.GET)
  public ResponseEntity&lt;Response&gt; readDocuments(
          @PathVariable(value = "var") String param1,
          @RequestParam(value = "param2", required = false, defaultValue = "string1") String param2,
          @RequestParam(value = "param3") @Size(min = 1) List&lt;String&gt; param3,
          @RequestParam(value = "param4", required = false) @Min(0) @Max(10) Integer param4)
      { 
          // do something
      }
  </code></pre>
  
  <p>Is it possible? If yes, can I define custom annotations following JSR 303 directives?</p>