背景:点击提交按钮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的更多相关文章

  1. HTTP Status 405 - Request method 'GET' not supported?(尚硅谷Restful案例练习关于Delete方法出现的错误)

    哈罗大家好,最近在如火如荼的学习java开发----Spring系列框架,当学习到SpringMVC,动手实践RESTFUL案例时,发现了以上报错405,get请求方法没有被支持. 首先第一步,我查看 ...

  2. 使用SpringMVC时报错HTTP Status 405 - Request method 'GET' not supported

    GET方法不支持.我出错的原因在于,在JSP中我希望超链接a以post方式提交,但是这里写js代码时出错. <script type="text/javascript"> ...

  3. springMVC出现HTTP Status 405 - Request method 'GET' not supported错误的解决方法

    今天在写一个简单的springMVC的表单请求处理时,出现了这个问题.我的form表单用的是post方法提交,并没有使用get方法,出现这个问题时,笔者可谓是一脸懵逼. 这是form表单: 这是对po ...

  4. Restful风格,PUT修改功能请求,表单中存在文件报错-HTTP Status 405 - Request method 'POST' not supported

    解决方案配置如下 <!-- 配置文件上传解析器 --> <bean id="multipartResolver" class="org.springfr ...

  5. 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 ...

  6. 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 ...

  7. Spring MVC出现POST 400 Bad Request &405 Request method 'GET' not supported

    首先描述一下出现错误的情景: 我刚学springmvc,想做一个登录界面的东西.然后试着写了一个controller如下: @RequestMapping(value = "/login&q ...

  8. SpringMVC框架出现 405 request method post not supported 的解决方法

    在SpringMVC框架中当使用post请求服务,然后请求成功转到一个静态文件,如html,htm等网页时.页面出现405 request method post not supported错误,只要 ...

  9. HTTP Status 405 - HTTP method GET is not supported by this URL

    问题概述: 借助MyEclipse直接建立了一个Servlet类,每次访问这个Servlet都能访问.可自己建立一个Servlet为什么总提示:HTTP Status 405 - HTTP metho ...

随机推荐

  1. 用scp实现多服务器文件分发

    需要安装expect环境 yum install expect -y vi ip.txt #主机地址池 192.168.1.1 192.168.1.2 192.168.3.3 #如果是同一网段也可以不 ...

  2. 推荐两款远程管理Linux工具(基于Windows系统)

    推荐两款远程管理Linux工具(基于Windows系统) 1.Xshell 百度百科:Xshell 是一个强大的安全终端模拟软件,它支持SSH1, SSH2, 以及Microsoft Windows ...

  3. 2019 ACM-ICPC 南京 现场赛 H. Prince and Princess

    题意 王子想要娶公主,但是需要完成一个挑战:在一些房间中找出公主在哪. 每个房间有一个人,他们彼此知道谁在哪个房间.可以问他们三种问题: 你是谁? 在某个房间是谁? 公主在哪个房间? 有三类人,一类一 ...

  4. C/C++程序员 面试经历总结

    最近在找工作,遇到了一些面试题,很惭愧的是很多都没答上来. 现在把一些问题总结一下,算是记录一下面试的经历吧.以后有空简单地回答一下, 同时也欢迎各位同仁解答,共同学习一下吧!   一.嵌入式C语言面 ...

  5. LVM-扩容目录

    LVM LVM是一种源自Unix环境,在Linux上广泛应用的逻辑虚拟盘存储方案.借助LVM,可以在保证各个Linux目录分区稳定,又可以实现各目录存储资源灵活分配. 本文主要系统介绍Linux环境下 ...

  6. css图片文字

    1.浏览器是把 html 和 css 一起下载并执行的,计算机里把两件事情同时做  异步加载.计算机中的同步异步和我们生活中的正好是相反的. 补充: 同步,是所有的操作都做完,才返回给用户结果.即写完 ...

  7. stdin stdout stderr - 标准 I/O 流

    Fd #include <stdio.h> Fd extern FILE *stdin; Fd extern FILE *stdout; Fd extern FILE *stderr; D ...

  8. shell 脚本文件类型.sh ,变量

    1. shell脚本编程的基本过程 (1)建立shell文件,以 .sh 结尾的文件 (2)赋予shell文件执行权限,chmod 0777 文件名 (3)执行shell文件, ./ 文件名 或者ba ...

  9. 前端学习(八)sass和bootstrap(笔记)

    less sass 和less基本上70%差不多(书写方式不一样) sass功能更多一点 1.定义一个变量 $b:blue; div{width:100px;height:100px; backgro ...

  10. python入门学习一

    本文用来记录学习python过程中所遇到的不同的或者记忆不清的一些定义. 注释 注释用# #此处是注释 n = 123 f = 456 不转义 Python中r‘  ’表示字符串默认不转义 print ...