From 11ac87099a93eeb38110a2e25dc2e2569282e336 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Thu, 17 Aug 2017 12:45:11 +0200 Subject: [PATCH] Prepare Web section for Servlet vs Reactive content Refer to both Servlet and reactive stacks in web.adoc Move web-integration.adoc to the very end Link in web-flux-functional.adoc Insert "Spring Web MVC" or "Servlet" prefix in chapter titles Issue: SPR-15149 --- src/docs/asciidoc/index.adoc | 2 +- src/docs/asciidoc/web.adoc | 24 +++++++++---------- src/docs/asciidoc/web/web-cors.adoc | 2 +- .../asciidoc/web/web-flux-functional.adoc | 20 +++++++++------- src/docs/asciidoc/web/web-flux.adoc | 4 ++-- src/docs/asciidoc/web/web-mvc.adoc | 2 +- src/docs/asciidoc/web/web-view.adoc | 2 +- src/docs/asciidoc/web/web-websocket.adoc | 2 +- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/docs/asciidoc/index.adoc b/src/docs/asciidoc/index.adoc index 6ea03c2480..2061a7e371 100644 --- a/src/docs/asciidoc/index.adoc +++ b/src/docs/asciidoc/index.adoc @@ -13,7 +13,7 @@ IoC container, with any web framework on top, but you can also use only the transaction management, remote access to your logic through RMI or web services, and various options for persisting your data. It offers full-featured web frameworks such as <> -and <>; and it enables you to +and <>; and it enables you to integrate <> transparently into your software. This document is a reference guide to Spring Framework features. Questions on the diff --git a/src/docs/asciidoc/web.adoc b/src/docs/asciidoc/web.adoc index e39f686261..4567b7254f 100644 --- a/src/docs/asciidoc/web.adoc +++ b/src/docs/asciidoc/web.adoc @@ -5,17 +5,13 @@ :toc: left :toclevels: 2 -This part of the reference documentation covers Spring Framework's support for the -presentation tier (and specifically web-based presentation tiers) including support -for WebSocket-style messaging in web applications. - -Spring Framework's own web framework, <>, is covered in the -first couple of chapters. Subsequent chapters are concerned with Spring Framework's -integration with other web technologies, such as <>. - -The section then concludes with comprehensive coverage of the Spring Framework -<> (including <>). - +This part of the documentation covers support for web applications. As of Spring Framework 5.0 +web applications can run on a traditional Servlet stack (Servlet API + Servlet container) +or on a reactive stack (Reactive Streams API + non-blocking runtime). +The first few chapters cover the Servlet-based <> web framework +including <>, <>, and <> support. +Subsequent chapters cover the <> reactive web framework +including its <> functional programming model. include::web/web-mvc.adoc[leveloffset=+1] @@ -23,8 +19,10 @@ include::web/web-view.adoc[leveloffset=+1] include::web/web-cors.adoc[leveloffset=+1] -include::web/web-integration.adoc[leveloffset=+1] - include::web/web-websocket.adoc[leveloffset=+1] include::web/web-flux.adoc[leveloffset=+1] + +include::web/web-flux-functional.adoc[leveloffset=+1] + +include::web/web-integration.adoc[leveloffset=+1] diff --git a/src/docs/asciidoc/web/web-cors.adoc b/src/docs/asciidoc/web/web-cors.adoc index 33b566fd4d..eb5042d404 100644 --- a/src/docs/asciidoc/web/web-cors.adoc +++ b/src/docs/asciidoc/web/web-cors.adoc @@ -1,5 +1,5 @@ [[cors]] -= CORS Support += Spring Web MVC CORS Support == Introduction diff --git a/src/docs/asciidoc/web/web-flux-functional.adoc b/src/docs/asciidoc/web/web-flux-functional.adoc index 2a3b0c57e8..ba34c848e9 100644 --- a/src/docs/asciidoc/web/web-flux-functional.adoc +++ b/src/docs/asciidoc/web/web-flux-functional.adoc @@ -1,8 +1,8 @@ -==== Functional Programming Model +[[webflux-fn]] += Spring WebFlux Functional Programming Model -NOTE: This section is to be merged into `web-flux.adoc`. - -===== HandlerFunctions +[[webflux-fn-handler-functions]] +== HandlerFunctions Incoming HTTP requests are handled by a **`HandlerFunction`**, which is essentially a function that takes a `ServerRequest` and returns a `Mono`. The annotation counterpart to a @@ -110,7 +110,8 @@ when the `Person` has been saved. variable `id`. We retrieve that `Person` via the repository, and create a JSON response if it is found. If it is not found, we use `switchIfEmpty(Mono)` to return a 404 Not Found response. -===== RouterFunctions +[[webflux-fn-router-functions]] +== RouterFunctions Incoming requests are routed to handler functions with a **`RouterFunction`**, which is a function that takes a `ServerRequest`, and returns a `Mono`. If a request matches a @@ -171,7 +172,8 @@ Most of the predicates found in `RequestPredicates` are compositions. For instance, `RequestPredicates.GET(String)` is a composition of `RequestPredicates.method(HttpMethod)` and `RequestPredicates.path(String)`. -====== Running a Server +[[webflux-fn-running]] +=== Running a Server Now there is just one piece of the puzzle missing: running a router function in an HTTP server. You can convert a router function into a `HttpHandler` by using @@ -206,10 +208,10 @@ tomcatServer.start(); ---- +// TODO: DispatcherHandler -TODO: DispatcherHandler - -===== HandlerFilterFunction +[[webflux-fn-handler-filter-function]] +== HandlerFilterFunction Routes mapped by a router function can be filtered by calling `RouterFunction.filter(HandlerFilterFunction)`, where `HandlerFilterFunction` is essentially a diff --git a/src/docs/asciidoc/web/web-flux.adoc b/src/docs/asciidoc/web/web-flux.adoc index 1fb5716b34..d0c6968d2a 100644 --- a/src/docs/asciidoc/web/web-flux.adoc +++ b/src/docs/asciidoc/web/web-flux.adoc @@ -1,5 +1,5 @@ -[[web-reactive]] -= WebFlux framework +[[webflux]] += Spring WebFlux framework This section provides basic information on the reactive programming support for Web applications in Spring Framework 5. diff --git a/src/docs/asciidoc/web/web-mvc.adoc b/src/docs/asciidoc/web/web-mvc.adoc index 5f88ba952e..e7a8a4923b 100644 --- a/src/docs/asciidoc/web/web-mvc.adoc +++ b/src/docs/asciidoc/web/web-mvc.adoc @@ -1,5 +1,5 @@ [[mvc]] -= Web MVC framework += Spring Web MVC framework :doc-spring-security: {doc-root}/spring-security/site/docs/current/reference [[mvc-introduction]] diff --git a/src/docs/asciidoc/web/web-view.adoc b/src/docs/asciidoc/web/web-view.adoc index 9ea984103f..520c718805 100644 --- a/src/docs/asciidoc/web/web-view.adoc +++ b/src/docs/asciidoc/web/web-view.adoc @@ -1,5 +1,5 @@ [[view]] -= View technologies += Spring Web MVC View Technologies [[view-introduction]] diff --git a/src/docs/asciidoc/web/web-websocket.adoc b/src/docs/asciidoc/web/web-websocket.adoc index c323de5bd1..c7419147e9 100644 --- a/src/docs/asciidoc/web/web-websocket.adoc +++ b/src/docs/asciidoc/web/web-websocket.adoc @@ -1,5 +1,5 @@ [[websocket]] -= WebSocket Support += Servlet Stack WebSocket Support :doc-spring-security: {doc-root}/spring-security/site/docs/current/reference