在地址栏输入网址访问页面 ,用的是GET方法。

在用ajax接收后台数据,根据返回值进行提示或页面跳转时报:WARN PageNotFound:208 - Request method 'POST' not supported

原因是在第二次加载登陆界面时,用的是POST方法,所以在controller中的 method="  ",方法要补充上post 或者 不写method。

@RequestMapping(value="/login",method=RequestMethod.GET)
    public String login()
    {
        return "login";
    }

改成:

@RequestMapping(value="/login",method ={RequestMethod.GET,RequestMethod.POST})
    public String login()
    {
        return "login";
    }

或者:

@RequestMapping(value="/login")
    public String login()
    {
        return "login";
    }

WARN PageNotFound:208 - Request method 'POST' not supported的更多相关文章

  1. 常见踩坑案例(二)-Request method 'POST' not supported

    一 前言 最近涉及到与前后端的数据对接,按道理来说没一点压力结果被一前端童鞋带坑里去了(不过也是很久没写过这种前后端分离进行联调的事情了,如果是一个人全套弄的话就不会出现下面问题). 二 Reques ...

  2. 记另类Request method 'GET' not supported

    一般遇到Request method 'GET' not supported这种问题,大家都会找相应controller下的具体方法,把get改为post之类.但是我这次是在访问静态资源,static ...

  3. 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控制台 ...

  4. org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'PUT' not supported

    1:先上控制台报错信息 org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'PUT' not ...

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

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

  6. Request method 'POST' not supported错误和解决方法

    在使用SpringBoot的时候,在html页面用form表单post提交数据的时候报错: Request method 'POST' not supported 错误解析: 我是用的前端页面是HTM ...

  7. springmvc访问静态资源出现Request method 'GET' not supported

    答案最后.:D 默认的访问的URL都会被DispatcherServlet所拦截. 这里说一下如何配置springmvc访问静态文件. <mvc:default-servlet-handler/ ...

  8. Request method 'GET' not supported

    Request method 'GET' not supported 错误原因: GET请求不被允许. 解决方法: 1.从客户端入手.假设浏览器中的js用了ajax发起异步请求GET,将GET改为PO ...

  9. 警告: Request method 'POST' not supported的原因之一

    警告: Request method 'POST' not supported是经常遇到的,这里记录一下我经常遇到的一种情况,以免忘记. 我使用拦截器拦截所有请求,然后列出不拦截的请求.有时候由于自己 ...

随机推荐

  1. Windows nessus安装

    1.官网下载nessus,下载速度很慢,要有耐心 2.安装,安装完成后访问https://localhost:8834,最好使用chrome浏览器 3.页面注册,更新plugins等 4.如果页面无法 ...

  2. nginx break-circus

    upstream : read-timeout,connection-timeout,分级别 500ms,1S,100S,长链接 ---颗粒度[每个服务api health-check]--- --- ...

  3. MFC全屏显示和多窗口动态显示的一些技巧和方法

    一.全屏 1.全屏窗口从dialogex继承,因为要处理一些东西 2.全屏代码,这样设置后尺寸不会出bug,只设置为最大值的话容易出bug //get current system resolutio ...

  4. 【转载】Python日期时间模块datetime详解与Python 日期时间的比较,计算实例代码

    本文转载自脚本之家,源网址为:https://www.jb51.net/article/147429.htm 一.Python中日期时间模块datetime介绍 (一).datetime模块中包含如下 ...

  5. Mock Server 实现post方法的接口(三)

    Mock Server 实现post方法的接口(三) 1.mock server实现的接口,当request中未设置"method"时,会自动将所有method试一次,所以一定要指 ...

  6. 如何修改运行中的docker容器的端口映射和挂载目录

    在docker run创建并运行容器的时候,可以通过-p指定端口映射规则.但是,我们经常会遇到刚开始忘记设置端口映射或者设置错了需要修改.当docker start运行容器后并没有提供一个-p选项或设 ...

  7. urlib库的使用

    urlib库实际上不是很常用,因为其api调用复杂,已被requests模块取代. 1.request发送请求 from urllib import request #默认指定的是get请求 #url ...

  8. [LeetCode] 139. Word Break_ Medium tag: Dynamic Programming

    Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine ...

  9. 20175211 2018-2019-2 《Java程序设计》第六周学习总结

    目录 教材学习内容总结 第七章 内部类与异常类 第十章 输入.输出流 教材学习中的问题和解决过程 代码托管 学习进度条 参考资料 教材学习内容总结 第七章 内部类与异常类 第十章 输入.输出流 教材学 ...

  10. principal(括号匹配+多组查询)

    题目传送门: 把所有括号相匹配的段直接预处理出来就行了 #include <bits/stdc++.h> using namespace std; #define ll long long ...