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 ...
随机推荐
- PAT乙级练习(1001)
1001 害死人不偿命的(3n+1)猜想 卡拉兹(Callatz)猜想: 对任何一个正整数 n,如果它是偶数,那么把它砍掉一半:如果它是奇数,那么把 (3n + 1) 砍掉一半.这样一直反复砍下去,最 ...
- PHP常用字符串函数总结
PHP语言中的字符串函数也是一个比较易懂的知识.今天我们就为大家总结了将近12种PHP字符串函数,希望对又需要的朋友有所帮助,增加读者朋友的PHP知识库. 1.查找字符位置函数 strpos($str ...
- Spring Cloud第四篇 | 客户端负载均衡Ribbon
本文是Spring Cloud专栏的第四篇文章,了解前三篇文章内容有助于更好的理解本文: Spring Cloud第一篇 | Spring Cloud前言及其常用组件介绍概览 Spring Cl ...
- react-native 相对项目路径导入组件 ___ babel-plugin-root-import
在使用react-native的时候,经常要自定义很多组件,但是只能使用../../../的方式,经常不记得这是多深,有没有一个插件,能自动帮我们解决这样的问题? 使用指南 我们使用的目标要达到以下的 ...
- 压缩感知重构算法之OMP算法python实现
压缩感知重构算法之OMP算法python实现 压缩感知重构算法之CoSaMP算法python实现 压缩感知重构算法之SP算法python实现 压缩感知重构算法之IHT算法python实现 压缩感知重构 ...
- flink基本原理
一.简介 开源流式处理系统在不断地发展,从一开始只关注低延迟指标到现在兼顾延迟.吞吐与结果准确性,在发展过程中解决了很多问题,编程API的易用性也在不断地提高.本文介绍一下 Flink 中的核心概念, ...
- UVA11324 The Lagest Lique(SCC缩点+DP)
Given a directed graph G, con- sider the following transformation. First, create a new graph T(G) to ...
- UVA-1608
We were afraid of making this problem statement too boring, so we decided to keep it short. A sequen ...
- MooseFS 分布式存储
一.MooseFS介绍 MooseFS主要由管理服务器(master).元日志服务器(Metalogger).数据存储服务器(chunkserver)构成. 管理服务器:主要作用是管理数据存储服务器, ...
- cs5642 v3摄像头拍照效果
4个摄像头拍照效果 配置的是ov5642_960p_RAW 测试图片分别如下: