Spring Boot Request method DELETE not supported
1: 开启HiddenHttpMethodFilter
最新版本的spring boot 默认不开启 restful 分割api
@Bean
@ConditionalOnMissingBean({HiddenHttpMethodFilter.class})
@ConditionalOnProperty(
prefix = "spring.mvc.hiddenmethod.filter",
name = {"enabled"},
matchIfMissing = false
)
开启办法:
# 启用hiddenMethod过滤器
spring.mvc.hiddenmethod.filter.enabled=true
通过使用隐藏域参数来
th:attr="del_uri=@{/emp/}+${emp.id}"
当然也可以使用传统POST 来做处理 , 在from里面多做几个参数
推荐使用 Ajax ,直接支持delete请求 不过需要浏览器支持
Spring Boot Request method DELETE not supported的更多相关文章
- Spring boot: Request method 'DELETE' not supported, Request method 'PUT' not supported, Request method 'POST' not supported
GET,POST,PUT,DELETE, Spring都支持,不要怀疑Spring, 一定是前端发送的rest 请求和后端的响应不匹配, 查找原因以及解决办法, 很简单 用chrome打开F12控制台 ...
- [Spring Boot]Request method 'GET' not supported
在网上查了些资料没有解决,检查代码发现 @PostMapping public String add(Employee employee){ System.out.println(employee); ...
- Spring MVC出现POST 400 Bad Request &405 Request method 'GET' not supported
首先描述一下出现错误的情景: 我刚学springmvc,想做一个登录界面的东西.然后试着写了一个controller如下: @RequestMapping(value = "/login&q ...
- oauth2(spring security)报错method_not_allowed(Request method 'GET' not supported)解决方法
报错信息 <MethodNotAllowed> <error>method_not_allowed</error> <error_description> ...
- 记另类Request method 'GET' not supported
一般遇到Request method 'GET' not supported这种问题,大家都会找相应controller下的具体方法,把get改为post之类.但是我这次是在访问静态资源,static ...
- org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'PUT' not supported
1:先上控制台报错信息 org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'PUT' not ...
- SpringMVC框架出现 405 request method post not supported 的解决方法
在SpringMVC框架中当使用post请求服务,然后请求成功转到一个静态文件,如html,htm等网页时.页面出现405 request method post not supported错误,只要 ...
- springmvc访问静态资源出现Request method 'GET' not supported
答案最后.:D 默认的访问的URL都会被DispatcherServlet所拦截. 这里说一下如何配置springmvc访问静态文件. <mvc:default-servlet-handler/ ...
- 常见踩坑案例(二)-Request method 'POST' not supported
一 前言 最近涉及到与前后端的数据对接,按道理来说没一点压力结果被一前端童鞋带坑里去了(不过也是很久没写过这种前后端分离进行联调的事情了,如果是一个人全套弄的话就不会出现下面问题). 二 Reques ...
随机推荐
- R语言学习笔记(2)——数据结构与数据集
一.数据集 数据集的概念 数据集是由数据组成的矩阵数组,行表示观测(observation),列表示变量(variable) 数据类型 数值型变量 PatientID.AdmData.Age 为数值型 ...
- Chapter 06—Basic graphs
三. 柱状图(Histogram) 1. hist():画柱状图 ·breaks(可选项):控制柱状图的小柱子的条数: ·freq=FALSE:基于概率(probability),而非频率(frequ ...
- C#程序编写高质量代码改善的157个建议[正确操作字符串、使用默认转型方法、却别对待强制转换与as和is]
前言 本文主要来学习记录前三个建议. 建议1.正确操作字符串 建议2.使用默认转型方法 建议3.区别对待强制转换与as和is 其中有很多需要理解的东西,有些地方可能理解的不太到位,还望指正. 建议1. ...
- Python 命令行之旅:深入 click 之增强功能
作者:HelloGitHub-Prodesire HelloGitHub 的<讲解开源项目>系列,项目地址:https://github.com/HelloGitHub-Team/Arti ...
- IntelliJ IDEA 2019.3安装激活破解使用教程
一. 前言 作为一枚程序员,你肯定对IntelliJ IDEA这个工具一点也不陌生!或许你没有用过,但你也一定听说过.作为在业界被公认为最好的java开发工具,IDEA每次大版本更新都备受瞩目.划重点 ...
- [TimLinux] Python nonlocal和global的作用
1. 执行代码 以下实例都是通过执行以下代码,需要把以下执行代码放在后面实例代码的后面. a = outer_func()print("call a()") a() a() a() ...
- 2019CCPC秦皇岛 F Forest Program
队友过的:https://blog.csdn.net/liufengwei1/article/details/101632506 Forest Program Time Limit: 2000/100 ...
- HDU3710 Battle over Cities(最小生成树+树链剖分+倍增+线段树)
Battle over Cities Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Othe ...
- CoderForces Round526 (A~E)题解
A. The Fair Nut and Elevator time limit per test 1 second memory limit per test 256 megabytes input ...
- 初探hook的键盘获取
初探hook的键盘获取 import pyHook import pythoncom class e(): keyIsPressed = False #键盘是否按下 按住.. def onKeyDow ...