Please, I have it ... with one error:
servlet code last line is incorrect and returns error "Void methods cannot return a value"
Please, any suggestions greatly appreciated.
public static void main(String[] args)
{
Main m = new Main();
List<JSONObject> jObj = m.getJsonObject();
StringBuilder sb = new StringBuilder();
for(int i =0 ; i < jObj.size(); i++)
{
sb.append(jObj.get(i).toString());
}
{
String responseStr = "{\"data\":[" + sb + "]}";
System.out.println(responseStr);
return responseStr;
}
}
}