Skip to content

added possibility to extend ModelAttributeMethodArgumentResolver #25265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

tdanylchuk
Copy link

Added possibility to extend ModelAttributeMethodArgumentResolver , in order to populate objects in same way, but with different set of data.

Example use-cases:

  • I want to populate object with data from headers, instead of common set of fields for model attribute resolution;
  • I want to manipulate with field values before set them to POJO in controller in case of custom annotated object

This is pretty much available in non-flux ModelAttributeMethodProcessor (since we can extend that and override some methods)

Logic in this class pretty much complicated to copy-paste or write own resolver, so I guess it's better to allow reuse code with possibility to add own data to bind.

…rder to populate objects in same way, but with different set of data.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 17, 2020
@jhoeller jhoeller added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 21, 2020
@jhoeller jhoeller added this to the 5.3 M1 milestone Jun 21, 2020
@jhoeller jhoeller self-assigned this Jun 23, 2020
@jhoeller jhoeller modified the milestones: 5.3 M1, 5.3 M2 Jun 23, 2020
@jhoeller jhoeller closed this in d61c0ee Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants