1,问题:通过后台向前台传json数据(含中文),前台显示????
解决: 在controller中修改为
@RequestMapping(value="/getType",produces="text/plain;charset=UTF-8")
@ResponseBody
public String getType(){
。。。
return string;
}
2,问题:前台向后台传json数据(含中文),,后台显示乱码
解决: 后台用 new String(test.getBytes("ISO_8859_1"),"utf-8");进行编码转换