jsonutils.tojsonstring能转化什么数据
4 回答

慕仙森
TA贡献1827条经验 获得超8个赞
调试一个程序时发现用jQuery的ajax方法和post方法分别发送请求,在后台Servlet进行处理时结果是不一样的,比如用$.ajax方法发送请求时(data参数是一个JSON.stringify()处理后的字符串,而不是一个JSON对象

紫衣仙女
TA贡献1839条经验 获得超15个赞
需要导入两个jar包
json-lib是用于转换json字符串的核心jar包,上面那个是辅助的。
转换json数组就是JSONArray.fromObject(arrayList).toString();
转换json对象就是JSONObject.fromObject(arrayList).toString();
添加回答
举报
0/150
提交
取消