@GET @Path("/") @Produces(MediaType.APPLICATION_JSON) public Response getItems() { System.out.println("get all items "); List<Item> items = ItemDao.getItems(); final GenericEntity<List<Item>> entity = new GenericEntity<List<Item>>(items) {}; return Response.ok() .entity(entity) .header("Access-Control-Allow-Origin", "*") .header("Access-Control-Allow-Methods", "POST, GET") .build(); }