方法
@RequestMapping(value=”editGood”,produces=”text/html;charset=UTF-8”)
@ResponseBody
public String editGood(HttpServletResponse response,HttpServletRequest request)
{
String gid = request.getParameter(“gid”);
GoodsInfo goodsInfo = goodsInfoService.findGoodsById(gid);
JSONObject result = JSONObject.parseObject(goodsInfo.toString());
String data = result.toJSONString();
System.out.println(data);
return data;
}
</code>
将原来的@RequestMapping("editGood")
改为
@RequestMapping(value="editGood",produces="text/html;charset=UTF-8")
其他的解决方案,待发现。