There was an unexpected error (type=Method Not Allowed, status=405). Request method 'POST' not supported
背景:点击提交按钮ajax请求接口时,报出错误【
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Jun 06 14:49:25 CST 2019
There was an unexpected error (type=Method Not Allowed, status=405).
Request method 'POST' not supported
】
原因:从字面意思看是提交方式错误,该错误提示极具迷惑性,实际是由于submit事件最后没有return false;导致的。ajax会提交一次,form表单自带的submit按钮也会提交,在onclick事件最后加上return false;form表单就不会再提交,不然就是提交两次,所以报上面那个错。
方法:

There was an unexpected error (type=Method Not Allowed, status=405). Request method 'POST' not supported的更多相关文章
- HTTP Status 405 - Request method 'GET' not supported?(尚硅谷Restful案例练习关于Delete方法出现的错误)
哈罗大家好,最近在如火如荼的学习java开发----Spring系列框架,当学习到SpringMVC,动手实践RESTFUL案例时,发现了以上报错405,get请求方法没有被支持. 首先第一步,我查看 ...
- 使用SpringMVC时报错HTTP Status 405 - Request method 'GET' not supported
GET方法不支持.我出错的原因在于,在JSP中我希望超链接a以post方式提交,但是这里写js代码时出错. <script type="text/javascript"> ...
- springMVC出现HTTP Status 405 - Request method 'GET' not supported错误的解决方法
今天在写一个简单的springMVC的表单请求处理时,出现了这个问题.我的form表单用的是post方法提交,并没有使用get方法,出现这个问题时,笔者可谓是一脸懵逼. 这是form表单: 这是对po ...
- Restful风格,PUT修改功能请求,表单中存在文件报错-HTTP Status 405 - Request method 'POST' not supported
解决方案配置如下 <!-- 配置文件上传解析器 --> <bean id="multipartResolver" class="org.springfr ...
- Spring Cloud / Spring Boot There was an unexpected error (type=Unauthorized, status=401). Full authentication is required to access this resource.
访问EndPoint时会出现没有权限 There was an unexpected error (type=Unauthorized, status=401). Full authenticat ...
- spring security There was an unexpected error (type=Forbidden, status=403).
https://blog.csdn.net/qq_27093097/article/details/83190240 spring security There was an unexpected e ...
- Spring MVC出现POST 400 Bad Request &405 Request method 'GET' not supported
首先描述一下出现错误的情景: 我刚学springmvc,想做一个登录界面的东西.然后试着写了一个controller如下: @RequestMapping(value = "/login&q ...
- SpringMVC框架出现 405 request method post not supported 的解决方法
在SpringMVC框架中当使用post请求服务,然后请求成功转到一个静态文件,如html,htm等网页时.页面出现405 request method post not supported错误,只要 ...
- HTTP Status 405 - HTTP method GET is not supported by this URL
问题概述: 借助MyEclipse直接建立了一个Servlet类,每次访问这个Servlet都能访问.可自己建立一个Servlet为什么总提示:HTTP Status 405 - HTTP metho ...
随机推荐
- nginx 配置反向代理和静态资源
https://unit.nginx.org/integration/ 与NGINX集成 在NGINX后面安装单元 将NGINX配置为静态Web服务器,并在Unit前面配置反向代理. NGINX直接从 ...
- gitlab+gitlab-ci+docker自动化部署
导言 本次测试用的是gitlab-ci,单纯与gitlab搭配而言,gitlab-ci较jenkins更加一体,顺畅. 主机1:192.168.100.151 gitlab 主机2:192.168.1 ...
- Django中的缓存机制
概述 对于中等流量网站来说,尽可能的减少开销是必要的.缓存数据就是为了保存那些需要很多计算资源大的结果,这样的的话就不必在下次重复消耗计算资源. Django自带了一个健壮的缓存系 ...
- Python编译源文件& 代码优化
编译源文件 代码优化 都能运行
- layout(布局)组件
一.依赖于 Panel(面 板)组件和 resizable(调整大小)组件. 二.class加载方式 <div id="box" class="easyui- ...
- 关于导出Excel出现异常的解决办法。:System.UnauthorizedAccessException: 检索 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件时失败
异常信息为:System.UnauthorizedAccessException: 检索 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} ...
- idae父子项目Test执行报Result Maps collection already contains value for xxx
现象:同一个springmvc工程使用eclipse和idea用Tomcat启动都没问题,但是如果走单元测试使用到了@ContextConfiguration这个spring的上下文注解idea出问题 ...
- JavaScript性能优化之摇树
作者|Jeremy Wagner译者|薛命灯 现代 Web 应用程序可能会变得非常巨大,特别是它们的 JavaScript 部分.HTTP Archive 网站的数据显示,截至 2018 年中,传输到 ...
- vue之路由导航守卫-全局前置守卫
一.使用方式 全局前置守卫用于在路由配置生效之前进行一些动作,可以使用 router.beforeEach 注册一个全局前置守卫: const router = new VueRouter({ ... ...
- Largest Submatrix 3
Largest Submatrix 3 给出一个\(n\times m\)的网格图,第i行第j列上的格子有数字\(a[i][j]\),显然,你可以从中找到一个子矩阵,保证子矩阵中的数字互不相同,求子矩 ...