{@link javax.servlet.Filter} that converts posted method parameters into HTTP methods,retrievable via {@link HttpServletRequest#getMethod()}. Since browsers currently only support GET and POST, a common technique - used by the Prototype library, for instance - is to use a normal POST with an additional hidden form field (
_method
) to pass the "real" HTTP method along. This filter reads that parameter and changes the {@link HttpServletRequestWrapper#getMethod()} return value accordingly.
The name of the request parameter defaults to _method
, but can be adapted via the {@link #setMethodParam(String) methodParam} property.
NOTE: This filter needs to run after multipart processing in case of a multipart POST request, due to its inherent need for checking a POST body parameter. So typically, put a Spring {@link org.springframework.web.multipart.support.MultipartFilter}before this HiddenHttpMethodFilter in your web.xml
filter chain.
@author Arjen Poutsma
@since 3.0