title: List<Object> to JSON using annotations
body: <p>OK, here goes, hopefully this makes sense! I have a small project based off of the appfuse web service only archetype. I have a business facade which has a DAO injected, through this DAO I request some data, simple example:</p>
  
  <pre><code>PersonManager.java
  
  @GET
  @Path("{people}")
  List&lt;Person&gt; getPeople(@QueryParam("surname") String surname);
  
  PersonManagerImpl.java (implements PersonManager)
  
  public List&lt;Person&gt; getPeople(String surname) {
      return personDao.getPeople(String surname);
  }
  </code></pre>
  
  <p>I can make a request to invoke this method through a URL configured to point to "getPeople", however, as the DAO returns the list of people as an array list, I get the following error</p>
  
  <p><code>Error serializing the response, please check the server logs, response class : ArrayList.</code></p>
  
  <p>I know I can wrap this method and use <code>Jackson Object Mapper</code> to change the list to a string, but I didn't want another layer in my code, just to marshal <code>JSON requests/responses.</code></p>
  
  <p>I also don't want to change the interface to return a string, because the interface may be used later to return other data types, thus, I don't want to lock it in to only returning a string representing JSON.</p>
  
  <p>My dilemma is that, I don't quite get how keeping the above interface and implementation, I can have Jackson convert the list of people to a json list of people, with annotations only!</p>
  
  <p>Any help is greatly appreciated.</p>
  
  <p>Please help!</p>