convert list to json using Jackson

后端 未结 4 1177
灰色年华
灰色年华 2020-12-21 02:04

With the below code I have converted list to json but the format is as follows:

{\"GodownMaster\":[{\"pname\":\"FCI CHARLAPALLI\",\"pcode\":\"16042\"},
         


        
4条回答
  •  轮回少年
    2020-12-21 02:44

    You add return type as Map, still you want the same then Just in ajaxComplete() put code;

    var response = '{"GodownMaster":[{"pname":"FCI CHARLAPALLI","pcode":"16042"}, {"pname":"MLS CIRCLE 1 L.B. NAGAR","pcode":"16016"},{"pname":"MLS CIRCLE 4 AZAMABAD","pcode":"16003"},{"pname":"MLS CIRCLE 6 VIDYANAGAR","pcode":"16005"},{"pname":"OTHERS","pcode":"1699"}]}'
    
    
    JSON.stringify(JSON.parse(response).GodownMaster);
    

提交回复
热议问题