Deprecate spring.mvc.ignore-default-model-on-redirect property
Closes gh-32381
This commit is contained in:
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…
Reference in New Issue