title: Spring 4 - reject "null" @RequestBody for all endpoints
body: <p>Jackson deserializes the "null" string as a null request body which is expected (although it would be nice to be able to switch this behaviour off). </p>
  
  <p>The code below triggers validation in case of "{}" payload but not in case of "null" payload. This forces me to do another check for null payload which doesn't seem normal to me since the PayloadValidator could include the null check itself. </p>
  
  <pre><code>@InitBinder
  protected void initBinder(WebDataBinder binder) {
    binder.setValidator(new PayloadValidator());
  }
  
  @RequestMapping(method = POST, value = "/my/path/here")
  public ResponseEntity&lt;String&gt; create(
    @Validated @RequestBody Payload payload
  ) {
    if (payload == null) {
      // Payload validation logic not in one place 
    }
    // useful work here
  }
  </code></pre>
  
  <ol>
  <li>Is there a generic way of rejecting null @RequestBody altogether (i.e. for all endpoints)?</li>
  <li>If not, can I have all the validation logic in one place and be automatically triggered (i.e. via @Validated or @Valid)?</li>
  </ol>
  
  <p>Thank you,
  Emanuel</p>