org.apache.tomcat.util.http.Parameters processParameters
警告: Parameters: Character decoding failed. Parameter skipped.
項目裡報這個錯,到網上查,是由於 ajax提交是 參數裡有 %。 解決方法也有好幾種。
我的情況是這樣的:
$.ajax({
type:"POST",
url:"approved_Customer.action",
data:"id="+customerid+"&taskid="+taskid+"&thiswfnodeid="+thiswfnodeid+"&postulate="+postulate+"&remark="+remark+"&type=reject&wflowId="+wflowId,
success:function(d){
$.messager.progress('close');
$.messager.alert('提示',d.msg,'info',function(){
if (d.success){
window.close();
window.opener.task_dagagrid.datagrid('load',{});
}
});
}
});這樣傳遞參數 如過參數裡 包含 % ,就會報上面所說的錯誤
我把它改成 json 格式 傳遞 就沒問題了
data:{id:customerid,taskid:taskid,thiswfnodeid:thiswfnodeid,postulate:postulate,remark:remark,type:'reject',wflowId:wflowId},
本文详细介绍了在使用AJAX进行数据提交时,如果参数中含有特殊字符如%,可能会导致Tomcat服务器解析失败的问题,并提供了将参数转换为JSON格式作为解决方案,有效避免了字符解码失败的错误。

185

被折叠的 条评论
为什么被折叠?



