title: Spring boot - json post request body as both POJO and string
body: <p>In a spring boot controller method, I can map the json post request body to a POJO e.g.</p>
  
  <pre><code>@PostMapping(value = "/abc")
  public String handleABC(
          @RequestBody User user
  ) {
      //code here...
  }
  </code></pre>
  
  <p>I can also retrieve the raw request body as a string:</p>
  
  <pre><code>@PostMapping(value = "/abc")
  public String handleABC(
          @RequestBody String request
  ) {
      //code here...
  }
  </code></pre>
  
  <p>My question is how can I map the request body to a POJO and also retrieve the raw request body as string (for logging purpose). </p>
  
  <p>Thanks </p>