title: How JSON body is converted to POJO in Spring MVC
body: <p>I have a class</p>
  
  <pre><code>class Student {
      String id;
      String name;
      //getters
      //setters
  }
  </code></pre>
  
  <p>I have a JSON Request</p>
  
  <pre><code>{
    "id": "1",
    "name": "asd",
  }
  </code></pre>
  
  <p>I have a REST API</p>
  
  <pre><code>@RequestMapping(value = "/student", method = RequestMethod.POST, produces = "application/json")
      public @ResponseBody String getstudent(HttpServletRequest request, HttpServletResponse response,
              @RequestBody Student student,
              @RequestHeader HttpHeaders requestHeaders) {
  
       return null;
  }
  </code></pre>
  
  <p>When I call this API, and visualise this <code>student</code> object, both the fields  have values from the request I provided.</p>
  
  <p>What I don't understand is:</p>
  
  <ol>
  <li><strong>how the JSON values got directly mapped to Student class object ?</strong></li>
  <li><strong>is there serialization/de-serialization involved ?</strong></li>
  <li><strong>is there any importance of constructor in student class ?</strong></li>
  </ol>