Skip to content
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

Webflux model in @GetMapping is empty #25313

Closed
dsyer opened this issue Jun 24, 2020 · 1 comment
Closed

Webflux model in @GetMapping is empty #25313

dsyer opened this issue Jun 24, 2020 · 1 comment
Assignees
Labels
status: duplicate A duplicate of another issue

Comments

@dsyer
Copy link
Member

dsyer commented Jun 24, 2020

This appears to be a regression (works with Spring Boot 2.3.0 and fails with 2.3.1). I think it's more likely to be a Webflux issue, but not really sure TBH. Consider this controller:

@Controller
public class SampleController {

	@GetMapping("/")
	public String home(Map<String, Object> model) {
		model.put("time", new Date());
		model.put("message", "Hello");
		return "index";
	}
}

The home() method is not called (I observe in a debugger) before the AbstractView is rendered, so the model is empty. Sample: https://github.com/scratches/SPR-25313.

UPDATE: it also works with Spring Boot 2.4.0-SNAPSHOT. So something is stuck in the middle there.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 24, 2020
@sdeleuze sdeleuze self-assigned this Jun 26, 2020
@sdeleuze sdeleuze added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 26, 2020
@sdeleuze
Copy link
Contributor

I made various tests:

  • It works with Boot 2.3.0.RELEASE and Framework 5.2.7.RELEASE
  • Boot master and 2.3.x branches fixes the issue
  • The issue does not happen if you rename the index view to something else or is you use a non-root path

It looks like a duplicate of spring-projects/spring-boot#21909, so I close this issue which is already fixed on Boot side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants