Spring-MVC中关于Java与JS中JSON的相互传递.md

简书迁移

Posted by thrfox on June 29, 2020

###Java中从model转换JSON

JSONObject JSONgoods  = JSONObject.fromObject(goods);
JSONgoods.toString();

###JS中解析JSON

var json2map = JSON.parse(data);
var map2json = JSON.stringify(str)