背景:点击提交按钮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. 关于sql中日期操作

    select * from account where  DAYOFWEEK('2019-11-30') =7 limit 10 DAYOFWEEK对应结果: 周日:1 周一:2 周二:3 周三:4 ...

  2. django 之模板层

    1. 模板语法之变量 格式:{{ 变量名 }} 句点符,深度查询(可以点到方法,不要加括号,只能是无参的方法) 代码 视图函数: from django.shortcuts import render ...

  3. 用Python实现一个简单的猜数字游戏

    import random number = int(random.uniform(1,10)) attempt = 0 while (attempt < 3): m = int(input(' ...

  4. qcom_IMS_conference_call小结

    1conference call建立 用QXDM抓qcom log: 1.拨号盘*#*#825364#*#*    ,  进入抓log UI 2.Connectivity-->USB Port ...

  5. jmeter beanshell 变量传递

    如果写成这样会报错: ${__BeanShell(${__threadNum}*2,ToatlAmount)}; ${__BeanShell(${__Random(1,99999,)},DayNum) ...

  6. android 样式和主题

  7. 案例-2D会旋转的盒子(rotate), 会缩放的盒子(scale),动画(animation)

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. JS window对象 返回浏览历史中的其他页面 go()方法,根据当前所处的页面,加载 history 列表中的某个具体的页面。 语法: window.history.go(number);

    返回浏览历史中的其他页面 go()方法,根据当前所处的页面,加载 history 列表中的某个具体的页面. 语法: window.history.go(number); 参数: 浏览器中,返回当前页面 ...

  9. Vim: Overwrite read-only file without quiting vim

    当你忘记以sudo命令使用vim编辑一个只读文件时,可以执行以下vim命令强制覆写该文件: :w !sudo tee % > /dev/null 命令太长,可在vimrc文件中做命令映射(映射为 ...

  10. Leetcode 200.岛屿的数量 - DFS、BFS

    Leetcode 200 岛屿的数量: DFS利用函数调用栈保证了检索顺序, BFS则需要自己建立队列,把待检索对象按规则入队. class Solution { // DFS解法,8ms/10.7M ...