-
Notifications
You must be signed in to change notification settings - Fork 38k
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
View Controller In Spring WebFlux [SPR-17031] #21569
Comments
Rossen Stoyanchev commented Indeed no reason not to. I'm assigning to 5.x backlog only because it's a bit late for the 5.1 backlog. |
Rossen Stoyanchev commented For the welcome page, we can make sure a default page can be mapped with a view controller but the actual welcome page would have to come from Boot. |
Ankur Pathak commented Can't we have Servlets semantics for welcome page. We would register default.html, index.html, index.htm as default views in view registry and render them in order. In case we use explicit view mapped to root path, it will overwrite them. |
Taking a step back, the main goals behind this are in my opinion:
In Spring MVC, this is achieved thanks to the In Spring WebFlux, the infrastructure is different and we can't implement it the same way. The implementation (minus the registry/registration classes) would look like this:
The implementation itself is really short and could provide more flexibility about ordering, response headers, or even path matching - like mapping I've had a look at other web frameworks, like Symfony, Rails and others. It looks like the approach taken by Laravel is quite similar to using With that in mind, I've got questions for @rstoyanchev and @poutsma :
|
After discussing the previous comment with team members, it seems that the main driver for this feature is the welcome page support in Spring Boot. There are many ways to achieve the equivalent of ViewController in WebFlux, including:
Because there is a way to directly implement the welcome page use case in Spring Boot, we'll close this issue for now until we get new requirements and use cases from the community. |
Ankur Pathak opened SPR-17031 and commented
Their is no support for View Controller In Spring Web Flux.
Why not have
addViewControllers(ViewControllerRegistry registry)
method inWebFluxConfigurer
similar toWebMvcConfigurer
?Their is no support for Welcome page like
index.html
also.Affects: 5.0 GA
Reference URL: spring-projects/spring-boot#9785
The text was updated successfully, but these errors were encountered: