// json对象
var jsonObj = {“name”:“sb”};
// 把json对象转化为json字符串并编码
var jsonStr = encodeURI(JSON.stringify(jsonObj));
// url后面添加参数
www.baidu.com?method=exportExpert&jsonStr=’+jsonStr;
后台
String jsonStr = request.getParameter(“jsonStr”);
// 转义 ":; 等字符
jsonStr = StringEscapeUtils.unescapeHtml(jsonStr);
// 把字符串转化为json对象
JSONObject jsonObject = JSONObject.fromObject(jsonStr);
// 把json对象转化为java对象
ExpertStore query = (ExpertStore) JSONObject.toBean(jsonObject, ExpertStore.class);