Jersey: Return a list of strings

Okay, I could fix it by searching the samples

This does work, but it can only be used for JSON and not for XML

@GET
@Produces({MediaType.APPLICATION_JSON})
@Path("/get")
public JSONArray get() {;
    return new JSONArray(dao.getStringList());
}

Fixes problem, but is there also a generic approach?

Leave a Comment