类 HiddenHttpMethodFilter

所有已实现的接口:
cn.taketoday.beans.factory.Aware, cn.taketoday.beans.factory.BeanNameAware, cn.taketoday.beans.factory.DisposableBean, cn.taketoday.beans.factory.InitializingBean, cn.taketoday.context.EnvironmentAware, cn.taketoday.core.env.EnvironmentCapable, ServletContextAware, Filter
直接已知子类:
OrderedHiddenHttpMethodFilter

public class HiddenHttpMethodFilter extends OncePerRequestFilter
Filter that converts posted method parameters into HTTP methods, retrievable via 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 HttpServletRequestWrapper.getMethod() return value accordingly. Only "PUT", "DELETE" and "PATCH" HTTP methods are allowed.

The name of the request parameter defaults to _method, but can be adapted via the 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.

从以下版本开始:
4.0 2022/2/20 23:44
作者:
Arjen Poutsma, Juergen Hoeller, Harry Yang