Skip to content

Instantly share code, notes, and snippets.

@kymtwyf
Last active October 31, 2015 09:31
Show Gist options
  • Save kymtwyf/d9285a2f7d83a7948d04 to your computer and use it in GitHub Desktop.
Save kymtwyf/d9285a2f7d83a7948d04 to your computer and use it in GitHub Desktop.
org.springframework.web.filter.HttpPutFormContentFilter config

Spring默认不支持直接用request.getParameter()来拿PUT方法的参数 (包括form-data 和 x-www-form-urlencoded)如果需要添加对其的支持,需要加上使用HttpPutFormContentFilter

参考

添加配置

<filter>
  <filter-name>httpPutFormContentFilter</filter-name>
  <filter-class>org.springframework.web.filter.HttpPutFormContentFilter</filter-class>
</filter>

<filter-mapping>
  <filter-name>httpPutFormContentFilter</filter-name>
  <servlet-name>dispatcher</servlet-name>
</filter-mapping>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment