Description
When using WebMvc.fn, the order of the registered mapping is:
RequestMappingHandlerMapping
(order 0, set by Framework)WelcomePageHandlerMapping
(order 2, set by Boot)RouterFunctionMapping
(order 3, set by Framework)
Which leads to the surprising behavior that a RouterFunction
define a user provided mapping on /
to render a index
template will be shadowed by WelcomePageHandlerMapping
serving this template. In my case, that half broke the rendering by skipping the model attributes that were set in the handler.
After a discussion with the Spring Framework team, we are going to try to improve the consistency between WebFlux (which has RouterFunctionMapping
before RequestMappingHandlerMapping
) and WebMvc (where this is the opposite) if possible (see spring-projects/spring-framework#30278) but we can't change that in a 5.3 or 6.0 patch release.
But I think I would be great if possible to fix Spring Boot 3.0 and potentially 2.7 to have WelcomePageHandlerMapping
after RouterFunctionMapping
.