【发布时间】:2021-11-13 22:05:01
【问题描述】:
单击更新或创建时出现 405 错误,如下面的屏幕截图所示。本地主机应用程序加载正常,但更新或创建按钮不起作用。通过 eclipse tomcat (spring-boot:run) 运行应用程序时它工作正常,但不起作用,我们将 war 文件部署到本地 tomcat。页面加载,但功能不起作用。
这是我正在尝试运行的应用程序https://github.com/mokarakaya/spring-boot-multi-module-maven
知道为什么会出现此错误吗?
按照 Piotr P. Karwasz 的建议修改代码。但是单击按钮时它仍然不起作用。它转到 localhost 并跳过 contextPath
function deleteRow(index,id) {
const contextPath = "/temp";
storageTypeUrl= $('select[name=storageType]').val() == "session" ? "sessionOperations" : "operations";
$.ajax({
async: false,
type: "DELETE",
url: contextPath+"/"+storageTypeUrl+"/?index="+index,
success: function(data){
console.log("delete Row successful");
},
error : function(request,error) {
alert(error);
}});
}
【问题讨论】:
-
您能否在收到此错误时添加应用程序日志。
-
没有日志设置。控制台没有显示任何错误。顺便说一句,Piotr P. Karwasz 答案有效,但是当单击更新或删除时它不起作用。为答案添加评论
标签: java eclipse spring-boot tomcat