title: JSON encoding using produces={"application/json; charset=UTF-8"} and ObjectMapper
body: <p>I am trying to develop a microservice using Spring MVC and Spring Boot. In my service I am giving result back as JSON encoded format. Currently I added action like:</p>
  
  <pre><code>@RequestMapping("/checkUsers")
      public String checkLogin() throws JsonProcessingException {
  
          ObjectMapper mapper = new ObjectMapper();
          List&lt;Users&gt; useObj = (List&lt;Users&gt;) userRepo.findAll();
          return(mapper.writeValueAsString(useObj));
      }
  </code></pre>
  
  <p>And now I found the other options through the following method </p>
  
  <pre><code>produces={"application/json; charset=UTF-8"} 
  </code></pre>
  
  <p>Here I am not sure which method is properly using for encoding the data into JSON format in Spring. How can I proceed?</p>