Deprecate spring.mvc.ignore-default-model-on-redirect property

Closes gh-32381
pull/32405/head
Phillip Webb 2 years ago
parent f0df4635c5
commit db89ee6904

@ -413,9 +413,14 @@ public class WebMvcAutoConfiguration {
@Qualifier("mvcValidator") Validator validator) {
RequestMappingHandlerAdapter adapter = super.requestMappingHandlerAdapter(contentNegotiationManager,
conversionService, validator);
setIgnoreDefaultModelOnRedirect(adapter);
return adapter;
}
@SuppressWarnings("deprecation")
private void setIgnoreDefaultModelOnRedirect(RequestMappingHandlerAdapter adapter) {
adapter.setIgnoreDefaultModelOnRedirect(
this.mvcProperties == null || this.mvcProperties.isIgnoreDefaultModelOnRedirect());
return adapter;
}
@Override

@ -130,10 +130,13 @@ public class WebMvcProperties {
return this.format;
}
@Deprecated
@DeprecatedConfigurationProperty(reason = "Deprecated for removal in Spring MVC")
public boolean isIgnoreDefaultModelOnRedirect() {
return this.ignoreDefaultModelOnRedirect;
}
@Deprecated
public void setIgnoreDefaultModelOnRedirect(boolean ignoreDefaultModelOnRedirect) {
this.ignoreDefaultModelOnRedirect = ignoreDefaultModelOnRedirect;
}

Loading…
Cancel
Save