-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
Kazuki Shimizu opened SPR-15009 and commented
In current implementation, We cannot customize the autoGrowCollectionLimit of DataBinder when set a custom MessageCodesResolver to the Spring MVC using WebMvcConfigurerAdapter or <mvc:annotation-driven>.
Because it initialize a BindingResult on the DataBinder as follow:
public void setMessageCodesResolver(MessageCodesResolver messageCodesResolver) {
getInternalBindingResult().setMessageCodesResolver(messageCodesResolver);
}I think it should be changed to same logic with ConversionService as follow:
public void setMessageCodesResolver(MessageCodesResolver messageCodesResolver) {
Assert.state(this.messageCodesResolver == null, "DataBinder is already initialized with MessageCodesResolver");
this.messageCodesResolver = messageCodesResolver;
if (this.bindingResult != null && messageCodesResolver != null) {
this.bindingResult.setMessageCodesResolver(messageCodesResolver);
}
}What do you think ?
I will submit a PR at the later.
Affects: 4.3.4
Issue Links:
- Detect invalid configuration for autoGrowCollectionLimit on DataBinder [SPR-14888] #19454 Detect invalid configuration for autoGrowCollectionLimit on DataBinder
Referenced from: pull request #1266, and commits 307e37a, 8d55c7d, 58eccfe, 361ab6b, 9f22928
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement