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) { @Qualifier("mvcValidator") Validator validator) {
RequestMappingHandlerAdapter adapter = super.requestMappingHandlerAdapter(contentNegotiationManager, RequestMappingHandlerAdapter adapter = super.requestMappingHandlerAdapter(contentNegotiationManager,
conversionService, validator); conversionService, validator);
setIgnoreDefaultModelOnRedirect(adapter);
return adapter;
}
@SuppressWarnings("deprecation")
private void setIgnoreDefaultModelOnRedirect(RequestMappingHandlerAdapter adapter) {
adapter.setIgnoreDefaultModelOnRedirect( adapter.setIgnoreDefaultModelOnRedirect(
this.mvcProperties == null || this.mvcProperties.isIgnoreDefaultModelOnRedirect()); this.mvcProperties == null || this.mvcProperties.isIgnoreDefaultModelOnRedirect());
return adapter;
} }
@Override @Override

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

Loading…
Cancel
Save