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.
Comment From: sdeleuze
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 https://github.com/spring-projects/spring-boot/issues/21909, so I close this issue which is already fixed on Boot side.