title: Getting error when using two @valid and BindingResult
body: <p>I am trying to validate both header and body of a post request using the below code</p>
  <pre><code>@PostMapping(path = &quot;/shelloo&quot;, consumes = &quot;application/json&quot;)
  public String ssfirst(@Valid @RequestHeader(&quot;username&quot;) String username, BindingResult headerBindingResult,
              @ModelAttribute RequestBodyModel requestBodyModel, BindingResult bodyBindingResult) {
      if (headerBindingResult.hasErrors())
          System.out.println(&quot;found header error&quot;);
      else if (bodyBindingResult.hasErrors())
          System.out.println(&quot;found body error&quot;);
      else
          System.out.println(&quot;else Print&quot;);
      return &quot;sample response&quot;;
  }
  </code></pre>
  <p>I am getting Exception as follow</p>
  <pre><code> java.lang.IllegalStateException: An Errors/BindingResult argument is expected to be declared immediately after the model attribute, the @RequestBody or the @RequestPart arguments to which they apply: public java.lang.String com.jvr.middlewareuat.rest.MainController.ssfirst(java.lang.String,org.springframework.validation.BindingResult,com.jvr.middlewareuat.model.RequestBodyModel,org.springframework.validation.BindingResult)
  </code></pre>