spring-projects / spring-projects/spring-framework

Support for @ModelAttribute dependency on webflux [SPR-16198]

Open
#20,746 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

in: web type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

Dongmin Shin opened SPR-16198 and commented

@ModelAttribute method arguments of @ModelAttribute annotated method are not resolved on webflux

@ModelAttribute("a")
public A attrA(@PathVariable String param1) {
    return new A(param1);
}

@ModelAttribute("b")
public B attrB(@ModelAttribute("a") A a, @RequestParam String param2) {
    // a.getParam1() is null
    return new B(a.getParam1(), param2);
}

cf.)


Affects: 5.0.1

References: pull request https://github.com/spring-projects/spring-framework/pull/2003

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the cited webflux ModelInitializer.java entry point with spring-web's ModelFactory.java behavior. Reproduce the @ModelAttribute example and trace how method arguments are resolved; done means the dependent @ModelAttribute receives the previously populated model attribute, with coverage for the demonstrated case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.