java ajax等传值中文乱码

来源:互联网 发布:淘宝助理宝贝描述红叉 编辑:程序博客网 时间:2024/06/07 01:27

js中:

function send(){
var selected = $('#intoGrid').datagrid('getSelected');
var url = "into/close.html?id="+selected.id+"&wmioRemark="+encodeURI(encodeURI($("#closeReasonform #wmioRemark").val()))+"&res="+Math.random();
$.post(url,function(data){
if(data){
closeTable();
$("#intoGrid").datagrid('reload');
$.messager.show({title:'友情提示',msg:data,timeout:5000,showType:'show'});
}
},"text"); 
}


  后台:

@RequestMapping(value="/close")

@ResponseBody
public void close(@RequestParam int wmioId,@RequestParam String wmioRemark){
try{
String msg=wmReceiptService.updateMsgAndCloseOfLog(wmioId,URLDecoder.decode(wmioRemark, "UTF-8"), getBackUser(),col);
return Tools.toJson(msg);
}catch(Exception e){
e.printStackTrace();
}
}

原创粉丝点击