Add welcome page support for Spring WebFlux

This commit adds the support for static and templated welcome pages with
Spring WebFlux. The implementation is backed by a `RouterFunction`
that's serving a static `index.html` file or rendering an `index` view.

Closes gh-9785
This commit is contained in:
Brian Clozel
2020-05-22 14:15:17 +02:00
parent ed4a7d4ba0
commit 525e03d3b5
5 changed files with 317 additions and 1 deletions

View File

@@ -2796,6 +2796,14 @@ Any resources with a path in `+/webjars/**+` are served from jar files if they a
TIP: Spring WebFlux applications do not strictly depend on the Servlet API, so they cannot be deployed as war files and do not use the `src/main/webapp` directory.
[[boot-features-webflux-welcome-page]]
==== Welcome Page
Spring Boot supports both static and templated welcome pages.
It first looks for an `index.html` file in the configured static content locations.
If one is not found, it then looks for an `index` template.
If either is found, it is automatically used as the welcome page of the application.
[[boot-features-webflux-template-engines]]
==== Template Engines