springMVC:org.springframework.web.servlet.PageNotFound.handleHttpRequestMethodNotSupported Request method 'POST' not supported

  1. org.springframework.web.servlet.PageNotFound.handleHttpRequestMethodNotSupported Request method 'POST' not supported
  1. Request method 'POST' not supported


Tomcat 8或者9下面的bug还是什么东西,需要加入如下解决方法:   

需要在web.xml配置过滤器

1
2
3
4
5
6
7
8
9
<filter>
       <filter-name>HiddenHttpMethodFilter</filter-name>
       <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
   </filter>
 
   <filter-mapping>
       <filter-name>HiddenHttpMethodFilter</filter-name>
       <url-pattern>/*</url-pattern>
   </filter-mapping>






原文地址:https://www.cnblogs.com/share2015/p/5338362.html