@AutoConfiguration(after = WebMvcAutoConfiguration.class) @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) public class GrailsFormContentFilterAutoConfiguration extends java.lang.Object
Guarantees a FormContentFilter for every Grails servlet web application, so
application/x-www-form-urlencoded bodies of PUT, PATCH and DELETE
requests are parsed into request parameters and are visible through the standard
request.getParameter(...) API. Only that content type is affected — other request bodies
(JSON, multipart, etc.) are untouched and remain available to data binding.
Spring Boot's WebMvcAutoConfiguration already contributes an OrderedFormContentFilter
for a default Grails application, in which case this auto-configuration backs off. It only fills the
gap when Boot's is absent — most notably when the application declares @EnableWebMvc, which
backs off the whole WebMvcAutoConfiguration. Grails supplies the filter itself so that form
parsing does not depend on Boot's MVC auto-configuration being active.
Ordered after WebMvcAutoConfiguration so Boot's filter, when present, takes precedence and
this one backs off via ConditionalOnMissingBean. The explicit opt-out
spring.mvc.formcontent.filter.enabled=false disables the filter here just as it does for Boot,
so it remains a true off-switch rather than something Grails silently re-enables.
| Modifiers | Name | Description |
|---|---|---|
static class |
GrailsFormContentFilterAutoConfiguration.FormContentParsingDisabledWarning |
Marker bean whose creation emits the startup warning above; present only when the form-content filter has been explicitly disabled. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public OrderedFormContentFilter |
formContentFilter() |
|
public GrailsFormContentFilterAutoConfiguration.FormContentParsingDisabledWarning |
formContentParsingDisabledWarning()Warns, once at startup, that form-content parsing has been switched off. |
| 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) |
Warns, once at startup, that form-content parsing has been switched off. Registered only when
spring.mvc.formcontent.filter.enabled=false is set and no FormContentFilter is
present, so a deliberate opt-out is visible rather than silently leaving PUT/PATCH/DELETE form
bodies unparsed — for controllers or for a plugin such as Spring Security.