想让list数组返回前端后可以被JSON.parse解析于是导入fastjson.jar包,结果返回前端报错,求解,
解析后的str报Cannot resolve symbol 'str'错误,看网上的教程说File->Invalidate Caches/Restart 清除缓存重启 ,尝试了还是报错
List<String[]> list = new ArrayList<String[]>();
if(1=1){
for (int i = 0; i < table.getNumRows(); i++) {
table.setRow(i);
ZMBLNR = table.getString("ZMBLNR"); //
VBELN = table.getString("VBELN"); //
NUMBER = table.getString("NUMBER");
MATNR = table.getString("MATNR");
MAKTX = table.getString("MAKTX");
KUNNR = table.getString("KUNNR");
NAME1 = table.getString("NAME1");
LFIMG = table.getString("LFIMG");
ZFIMG = table.getString("ZFIMG");
MBLNR = table.getString("MBLNR");
ZCNAME = table.getString("ZCNAME");
ZSDATS_TIMS = table.getString("ZSDATS_TIMS");
VTWEG = table.getString("VTWEG");
list.add(new String[]{ZMBLNR,VBELN,NUMBER,MATNR,MAKTX,KUNNR,NAME1,LFIMG,ZFIMG,MBLNR,ZCNAME,ZSDATS_TIMS,VTWEG });
String str=JSON.toJSON(list).toString();
}}
out.print(" { \"result\": \"" + result + "\", \"msg\" : \"" + msg + "\" , \"list\" : \"" + str + "\", \"flag\" : \"" + flag
+ "\" } ");