title: How to make java rest api return multiple json objects
body: <p>I'm creating a REST Service in JAva, and below is the code part:</p>
  
  <pre><code>@GET
  @Path("/getsummary")
  @Produces("application/json")
  
  public Response summary()
  {
  
          VoltDAOImpl voltDao = new VoltDAOImpl();
          Map&lt;String ,List&lt;HashMap&lt;String,String&gt;&gt;&gt; returnList=       voltDao.getOrderDetails("PEAKM" , "Hydra" ,
                   "" ,  voltDao.client,"notional" ,1000);
          List&lt;HashMap&lt;String,String&gt;&gt; totalSlpSummaryList = returnList.get("total_slp_summary");
          List&lt;HashMap&lt;String,String&gt;&gt; totalSlpSummaryBySideList = returnList.get("total_slp_summary_by_side");
          ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
  
              String json1 = null;
              String json2 = null;
              try {
                  json1 = ow.writeValueAsString(totalSlpSummaryList);
                  json2 = ow.writeValueAsString(totalSlpSummaryBySideList);
                  System.out.println(json1);
                  System.out.println(json2);
              } catch (IOException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
  
      return Response.status(200).entity(json1).build();
  }
  </code></pre>
  
  <p>Right now, the above is only returning json1 object but I want it to return both json1 and json2. How do I achieve that?</p>