框架用的SpringMVC,使用FormData对象,采用ajax提交表单到controller.顺利提交到后台,后台功能顺利执行,但是返回时总是调用error。求救!!!!!!!!以下是ajax部分代码function releaseCourseware(){ var form = new FormData(document.getElementById("releasecoursewareformid")); $("#myModal").hide(); $.ajax({ url:"${pageContext.request.contextPath }/course/insertOneCourse.do", type:"post", data:form, dataType:"text", processData:false, contentType:false, success:function(data){ alert("发布成功!"); $("#justforquery").attr("action","${pageContext.request.contextPath}/course/courseResourceList.do"); $("#justforquery").submit(); },error:function(e){ alert("发布失败!!"); $("#justforquery").attr("action","${pageContext.request.contextPath}/course/courseResourceList.do"); $("#justforquery").submit(); } }); } |