乱码现象处理示例:
function jrnew(){
var path=currentProjectPath+"/supervision-statistics/log/getNewInfo.shtml";
$.ajax({
type:"post",
url:path,
dataType:"text",
async :false,
success:function(returndata){
document.getElementById('newinfo').innerHTML = returndata;
}
})
}
@RequestMapping("/getNewInfo")
@ResponseBody
public void getNewInfo(HttpServletResponse response) throws Exception{//注此方法不能设置成返回string字符串,否则出现乱码的现象
HtmlUtil.writerJson(response, sysLogService.getNewInfo());
}