我正在使用restful webservice,我从中得到json,如下所示
response = [{"id":1,"name":"Appetizers","image":"iVBORw0KGgoAAAANSUhEUgAAADgAAAAkCAIAAABT8G6pAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABb5SURBVFhHPVgHUFPrtmbevTPvvnPvO8eKKJ1ASAikEEIaSYBAEkroSLWBHex67A3FBhYsWEFUBBuCDRRRpCMlhPS+0zs1gHD0HN72vjfvnzV/dpI9s7 ....
之后我想将此 json 转换为 JSONObject
JSONObject obj = new JSONObject(response);
当我执行这个命令时,我得到了以下错误
org.json.JSONException: Value [{"resturantID":{"phoneNo":"a","id":1,"fax":"a","address":"a" ...
当我使用 glassfish 3 时,我的程序运行良好,因为 json 结构与此不同,这是什么问题?