title: Spring MVC - How to return simple String as JSON in Rest Controller
body: <p>My question is essentially a follow-up to <a href="https://stackoverflow.com/questions/23581619/simple-string-as-json-return-value-in-spring-rest-controller">this</a> question.</p>
  
  <pre><code>@RestController
  public class TestController
  {
      @RequestMapping("/getString")
      public String getString()
      {
          return "Hello World";
      }
  }
  </code></pre>
  
  <p>In the above, Spring would add "Hello World" into the response body. How can I return a String as a JSON response?  I understand that I could add quotes, but that feels more like a hack.</p>
  
  <p>Please provide any examples to help explain this concept.</p>
  
  <blockquote>
    <p><strong>Note:</strong> I don't want this written straight to the HTTP Response body, I want to return the String in JSON format (I'm using my Controller
    with <a href="https://resty-gwt.github.io/" rel="noreferrer">RestyGWT</a> which requires the response to be in valid JSON
    format).</p>
  </blockquote>