Ajax上传file出现的bad request问题
var formData = new FormData($("#form")[0]); $.ajax({ url:'${pageContext.request.contextPath}/manage/matrix/add', type:'post', data:formData, async : false, cache : false, contentType : false, processData : false, success:function(data){ myAlert(data.message,function(){ window.location.href="${pageContext.request.contextPath}/manage/matrix/list"; }); }, error:function(){ myAlert("网络错误",function(){ window.location.href="${pageContext.request.contextPath}/manage/matrix/list"; }); } });