I\'m having problems with the method JSONObject sayJSONHello().
@Path(\"/hello\")
public class SimplyHello {
@GET
@Produces(MediaType.A
If you can accept a List as a result, and also can accept using Gson, there is a pretty easy way of doing this, in just a few lines of code:
Type listType = new TypeToken>() {}.getType();
List numbers = new Gson().fromJson(jobj.get("numbers"), listType);
I realize this is not exactly what you are asking for, but in my experience, a list of integers can be used in many of the same ways as a basic int[]. Further info on how to convert a linkedlist to an array, can be found here: How to convert linkedlist to array using `toArray()`?