You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spring webflux @ModelAttribute annotated methods not working with kotlin suspend methods #30894
I am using spring webflux with spring boot 3.1.0 and 1.1.0 io.spring.dependency-management gradle plugin(spring webflux 6.0.9).
According to documentation, spring should call methods annotated with @ModelAttribute before any @RequestMapping, and it should support reactive types for web flux. This works fine for Mono and Flux return types, but it doesn't work with kotlin suspend functions.
In the example above, methods annotated with @ModelAttribute are invoked after the @GetMapping annotated method when I debug with breakpoints.
Also, the first suspend method,even though invoked after @GetMapping, still populates the model correctly because it doesn't cause NullPointerException when rendering the view. But the second suspend method,which is also invoked after the @GetMapping, doesn't populate the model and I am getting NullPointerException when rendering the view because roles is null.
Activity
Fix ModelInitializerKotlinTests