@AutoConfiguration(after = WebMvcAutoConfiguration.class) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) public class GrailsHiddenHttpMethodFilterAutoConfiguration extends java.lang.Object
Registers Grails' hidden HTTP method filter, which rewrites a POST carrying a _method
parameter or an X-HTTP-Method-Override header before the request reaches the dispatcher.
Neither this filter nor Spring Boot's is registered by default as of Grails 8; the _method
parameter is resolved inside the dispatcher instead, after multipart handling and after the filter chain.
A filter is contributed only when an application asks for one, through either
Settings.WEB_HIDDEN_METHOD_FILTER_ENABLED or Spring Boot's
spring.mvc.hiddenmethod.filter.enabled.
Ordered after WebMvcAutoConfiguration so that Boot's own filter, when it registers one, is
already present and this backs off through ConditionalOnMissingBean — which also avoids the two
definitions colliding on the shared hiddenHttpMethodFilter bean name. Filling the gap matters:
Boot's filter lives on WebMvcAutoConfiguration, which backs off entirely for an application
declaring @EnableWebMvc, so asking for Boot's filter there would otherwise yield no filter at all.
Contributing one keeps the promise that
HiddenHttpMethod.isServletFilterMode relies on: whenever either property is
set, a filter really is on the chain.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public FilterRegistrationBean<Filter> |
hiddenHttpMethodFilter() |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |