图中params包含多个参数,具体如下:
{"rzrq":"2019-01-21","rzlx":"1","nr":"","jsonStr":"[{'gzlx':'1','gznr':'11','gzcg':'11','czwt':'11','yjjy':'11','rzgl_id':'','px':1},{'gzlx':'1','gznr':'22','gzcg':'33','czwt':'22','yjjy':'22','rzgl_id':'','px':2}]"}
jfinal框架中后台接受代码:
String params = getPara("params"); JSONObject paramStr = JSONObject.fromObject(params); String rzrq = (String) paramStr.get("rzrq"); String rzlx = (String) paramStr.get("rzlx"); String nr = (String) paramStr.get("nr"); String jsonStr = (String) paramStr.get("jsonStr"); |
注意:jsonStr中的参数需要用‘’进行包装,不能用“”,否则会报错。