`
lovetulong
  • 浏览: 9696 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Request method 'POST' not supported

 
阅读更多

今天项目里面出现了Request method 'POST' not supported。一个不容易发现的原因导致的,记录下来,以便后来的人别花太多的时间在这个上面。

我们项目使用的是 Spring MVC + Freemarker。

出现此问题的现象:

1. 页面上直接form提交,并且已经指明 method=“post”

<form action="xxxx" class="tableForm" method="post"></form>

2. Spring controller未指明method,所以get, post都支持

@RequestMapping(value = "/orderList")

3. 在我的controller执行完成之后返回到我指定的页面的时候出现的错误

 

出现此问题的原因:

简单的说就是我页面上include了其他的ftl文件,这个ftl文件又调用了一个controller,这个controller指明了使用get方式调用,所以报错了。也就是为什么我的方法是在返回ftl之后报错的。

 

总结:

Request method 'POST/GET' not supported  就是在页面上请求的method和controller中指定的method不一样出现的错误。简单的就是直接提交的controller上的问题。复杂的就是请求的页面中include了其他页面,其他页面又用include_page调用了不一样的method的controller出现的错误。

分享到:
评论

相关推荐

    http请求405错误方法不被允许的解决 (Method not allowed)

    主要介绍了http请求405错误方法不被允许的解决 (Method not allowed),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

    jsp中kindeditor的用和遇到的问题总结附上项目配置

    jsp中kindeditor的用和遇到的问题总结附上项目配置。综合别人的再加上自己做的。并含有一个简单的测试工程和kindeditor的压缩包

    微信小程序 HTTPS报错整理常见问题及解决方案

    主要介绍了微信小程序 HTTPS报错常见问题及解决方案的相关资料,需要的朋友可以参考下

    Senfore_DragDrop_v4.1

    Earlier versions of Delphi and C++ Builder will not be supported. If you need Delphi 3 or C++ Builder 3 support you will have to revert to version 3.7 of the Drag and Drop Component Suite. The ...

    8-07-14_MegaCLI for linux_windows

    SCGCQ00318648 Defect VD creation on regular drives fails for older firmware where 4K sector is not supported SCGCQ00319423 Defect FreeBSD MegaCLI v8.05.02 does not detect controller when driver 5.504....

    google api php client

    These client libraries are officially supported by Google. However, the libraries are considered complete and are in maintenance mode. This means that we will address critical bugs and security issues...

    tomcat解决跨域访问问题配置

    &lt;param-value&gt;token,Access-Control-Allow-Origin,Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers --&gt; &lt;param-value&gt;Access-Control-Allow-Origin,...

    Clever Internet Suite (SRC) v9.1.0.0

    Clever Internet Suite version 9.1...IMAP client - the AppendMessage method did not work with GMail IMAP - fixed. FTP client - the file names with international symbols were obtained incorrectly - fixed. ...

    php.ini-development

    documents, however this remains supported for backward compatibility reasons. ; Note that this directive does not control the , which can be ; used regardless of this directive. ; Default Value: On ;...

    BURNINTEST--硬件检测工具

    Windows 98 and ME are not supported in BurnInTest version 5.3 and above. Use a version of BurnInTest prior to 5.2 for compatibility with W98 and ME. Windows 95 and Windows NT =======================...

Global site tag (gtag.js) - Google Analytics