title: Returning the JSON representation of a String with Jersey
body: <p>I'm about to setup a REST-Webservice with Jersey.
  At the moment I am a bit confused about the correct representation of Strings or other Value types in JSON.
  Here are two snippets:</p>
  
  <pre><code>@GET
  @Path("user")
  @Produces( MediaType.APPLICATION_JSON)
  public User user() {
      return new User("reini", "admin");
  }
  </code></pre>
  
  <p>Calling this method in a Browser will display a "good" JSON String like that:</p>
  
  <pre><code>{"name":"reini","role":"admin"}
  </code></pre>
  
  <p>My second method looks like this:</p>
  
  <pre><code>@GET
  @Path("hello/{name}")
  @Produces( MediaType.APPLICATION_JSON)
  public String hello(@PathParam("name") String name) {
      return "Hello " + name + ", it is " + new Date();
  }
  </code></pre>
  
  <p>Calling that method in a Browswer will display a pure String without any JSON-Stuff (Curly Braces etc):</p>
  
  <pre><code>Hello firefox, it is Tue Sep 18 13:52:57 CEST 2012
  </code></pre>
  
  <p>I want to consume this service with the dojo toolkit. The problem is, that I get an for the second method as soon as I set [handleAs: "json"]-flag. It throws me an error "SyntaxError: Unexpected token H" where "H" is the first letter of the returned string.</p>
  
  <p>So: What is the correct json representation of Strings and other value types and what annotations I have to set for my method to produce these?</p>