Skip to content

Commit

Permalink
Update links between WebFlux and Web MVC
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev committed Nov 26, 2019
1 parent 30d68f2 commit 5a552f1
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 195 deletions.
2 changes: 1 addition & 1 deletion src/docs/asciidoc/integration.adoc
Expand Up @@ -1113,7 +1113,7 @@ converters to use explicitly.

[[rest-message-conversion]]
===== Message Conversion
[.small]#<<web-reactive.adoc#webflux-codecs, Same as in Spring WebFlux>>#
[.small]#<<web-reactive.adoc#webflux-codecs, WebFlux>>#

The `spring-web` module contains the `HttpMessageConverter` contract for reading and
writing the body of HTTP requests and responses through `InputStream` and `OutputStream`.
Expand Down
12 changes: 6 additions & 6 deletions src/docs/asciidoc/web/webflux-cors.adoc
@@ -1,6 +1,6 @@
[[webflux-cors]]
= CORS
[.small]#<<web.adoc#mvc-cors, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-cors, Web MVC>>#

Spring WebFlux lets you handle CORS (Cross-Origin Resource Sharing). This section
describes how to do so.
Expand All @@ -10,7 +10,7 @@ describes how to do so.

[[webflux-cors-intro]]
== Introduction
[.small]#<<web.adoc#mvc-cors-intro, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-cors-intro, Web MVC>>#

For security reasons, browsers prohibit AJAX calls to resources outside the current origin.
For example, you could have your bank account in one tab and evil.com in another. Scripts
Expand All @@ -27,7 +27,7 @@ powerful workarounds based on IFRAME or JSONP.

[[webflux-cors-processing]]
== Processing
[.small]#<<web.adoc#mvc-cors-processing, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-cors-processing, Web MVC>>#

The CORS specification distinguishes between preflight, simple, and actual requests.
To learn how CORS works, you can read
Expand Down Expand Up @@ -77,7 +77,7 @@ To learn more from the source or to make advanced customizations, see:

[[webflux-cors-controller]]
== `@CrossOrigin`
[.small]#<<web.adoc#mvc-cors-controller, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-cors-controller, Web MVC>>#

The {api-spring-framework}/web/bind/annotation/CrossOrigin.html[`@CrossOrigin`]
annotation enables cross-origin requests on annotated controller methods, as the
Expand Down Expand Up @@ -230,7 +230,7 @@ as the following example shows:

[[webflux-cors-global]]
== Global Configuration
[.small]#<<web.adoc#mvc-cors-global, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-cors-global, Web MVC>>#

In addition to fine-grained, controller method-level configuration, you probably want to
define some global CORS configuration, too. You can set URL-based `CorsConfiguration`
Expand Down Expand Up @@ -299,7 +299,7 @@ as the following example shows:

[[webflux-cors-webfilter]]
== CORS `WebFilter`
[.small]#<<web.adoc#mvc-cors-filter, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-cors-filter, Web MVC>>#

You can apply CORS support through the built-in
{api-spring-framework}/web/cors/reactive/CorsWebFilter.html[`CorsWebFilter`], which is a
Expand Down
12 changes: 6 additions & 6 deletions src/docs/asciidoc/web/webflux-functional.adoc
@@ -1,6 +1,6 @@
[[webflux-fn]]
= Functional Endpoints
[.small]#<<web.adoc#webmvc-fn, Same as in Spring MVC>>#
[.small]#<<web.adoc#webmvc-fn, Web MVC>>#

Spring WebFlux includes WebFlux.fn, a lightweight functional programming model in which functions
are used to route and handle requests and contracts are designed for immutability.
Expand All @@ -12,7 +12,7 @@ the same <<web-reactive.adoc#webflux-reactive-spring-web>> foundation.

[[webflux-fn-overview]]
== Overview
[.small]#<<web.adoc#webmvc-fn-overview, Same as in Spring MVC>>#
[.small]#<<web.adoc#webmvc-fn-overview, Web MVC>>#

In WebFlux.fn, an HTTP request is handled with a `HandlerFunction`: a function that takes
`ServerRequest` and returns a delayed `ServerResponse` (i.e. `Mono<ServerResponse>`).
Expand Down Expand Up @@ -112,7 +112,7 @@ Most applications can run through the WebFlux Java configuration, see <<webflux-

[[webflux-fn-handler-functions]]
== HandlerFunction
[.small]#<<web.adoc#webmvc-fn-handler-functions, Same as in Spring MVC>>#
[.small]#<<web.adoc#webmvc-fn-handler-functions, Web MVC>>#

`ServerRequest` and `ServerResponse` are immutable interfaces that offer JDK 8-friendly
access to the HTTP request and response.
Expand Down Expand Up @@ -440,7 +440,7 @@ See <<core.adoc#validation-beanvalidation, Spring Validation>>.

[[webflux-fn-router-functions]]
== `RouterFunction`
[.small]#<<web.adoc#webmvc-fn-router-functions, Same as in Spring MVC>>#
[.small]#<<web.adoc#webmvc-fn-router-functions, Web MVC>>#

Router functions are used to route the requests to the corresponding `HandlerFunction`.
Typically, you do not write router functions yourself, but rather use a method on the
Expand Down Expand Up @@ -639,7 +639,7 @@ We can further improve by using the `nest` method together with `accept`:

[[webflux-fn-running]]
== Running a Server
[.small]#<<web.adoc#webmvc-fn-running, Same as in Spring MVC>>#
[.small]#<<web.adoc#webmvc-fn-running, Web MVC>>#

How do you run a router function in an HTTP server? A simple option is to convert a router
function to an `HttpHandler` by using one of the following:
Expand Down Expand Up @@ -745,7 +745,7 @@ The following example shows a WebFlux Java configuration (see

[[webflux-fn-handler-filter-function]]
== Filtering Handler Functions
[.small]#<<web.adoc#webmvc-fn-handler-filter-function, Same as in Spring MVC>>#
[.small]#<<web.adoc#webmvc-fn-handler-filter-function, Web MVC>>#

You can filter handler functions by using the `before`, `after`, or `filter` methods on the routing
function builder.
Expand Down
22 changes: 11 additions & 11 deletions src/docs/asciidoc/web/webflux-view.adoc
@@ -1,6 +1,6 @@
[[webflux-view]]
= View Technologies
[.small]#<<web.adoc#mvc-view, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-view, Web MVC>>#

The use of view technologies in Spring WebFlux is pluggable. Whether you decide to
use Thymeleaf, FreeMarker, or some other view technology is primarily a matter of a
Expand All @@ -12,7 +12,7 @@ WebFlux. We assume you are already familiar with <<webflux-viewresolution>>.

[[webflux-view-thymeleaf]]
== Thymeleaf
[.small]#<<web.adoc#mvc-view-thymeleaf, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-view-thymeleaf, Web MVC>>#

Thymeleaf is a modern server-side Java template engine that emphasizes natural HTML
templates that can be previewed in a browser by double-clicking, which is very
Expand All @@ -33,7 +33,7 @@ http://forum.thymeleaf.org/Thymeleaf-3-0-8-JUST-PUBLISHED-td4030687.html[announc

[[webflux-view-freemarker]]
== FreeMarker
[.small]#<<web.adoc#mvc-view-freemarker, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-view-freemarker, Web MVC>>#

https://freemarker.apache.org/[Apache FreeMarker] is a template engine for generating any
kind of text output from HTML to email and others. The Spring Framework has built-in
Expand All @@ -43,7 +43,7 @@ integration for using Spring WebFlux with FreeMarker templates.

[[webflux-view-freemarker-contextconfig]]
=== View Configuration
[.small]#<<web.adoc#mvc-view-freemarker-contextconfig, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-view-freemarker-contextconfig, Web MVC>>#

The following example shows how to configure FreeMarker as a view technology:

Expand Down Expand Up @@ -98,7 +98,7 @@ returns the view name, `welcome`, the resolver looks for the

[[webflux-views-freemarker]]
=== FreeMarker Configuration
[.small]#<<web.adoc#mvc-views-freemarker, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-views-freemarker, Web MVC>>#

You can pass FreeMarker 'Settings' and 'SharedVariables' directly to the FreeMarker
`Configuration` object (which is managed by Spring) by setting the appropriate bean
Expand Down Expand Up @@ -151,7 +151,7 @@ the `Configuration` object.

[[webflux-view-freemarker-forms]]
=== Form Handling
[.small]#<<web.adoc#mvc-view-freemarker-forms, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-view-freemarker-forms, Web MVC>>#

Spring provides a tag library for use in JSPs that contains, among others, a
`<spring:bind/>` element. This element primarily lets forms display values from
Expand All @@ -162,7 +162,7 @@ with additional convenience macros for generating form input elements themselves

[[webflux-view-bind-macros]]
==== The Bind Macros
[.small]#<<web.adoc#mvc-view-bind-macros, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-view-bind-macros, Web MVC>>#

A standard set of macros are maintained within the `spring-webflux.jar` file for
FreeMarker, so they are always available to a suitably configured application.
Expand Down Expand Up @@ -193,7 +193,7 @@ sections of the Spring MVC documentation.

[[webflux-view-script]]
== Script Views
[.small]#<<web.adoc#mvc-view-script, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-view-script, Web MVC>>#

The Spring Framework has a built-in integration for using Spring WebFlux with any
templating library that can run on top of the
Expand All @@ -219,7 +219,7 @@ TIP: The basic rule for integrating any other script engine is that it must impl

[[webflux-view-script-dependencies]]
=== Requirements
[.small]#<<web.adoc#mvc-view-script-dependencies, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-view-script-dependencies, Web MVC>>#

You need to have the script engine on your classpath, the details of which vary by script engine:

Expand All @@ -239,7 +239,7 @@ through https://www.webjars.org/[WebJars].

[[webflux-view-script-integrate]]
=== Script Templates
[.small]#<<web.adoc#mvc-view-script-integrate, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-view-script-integrate, Web MVC>>#

You can declare a `ScriptTemplateConfigurer` bean to specify the script engine to use,
the script files to load, what function to call to render templates, and so on.
Expand Down Expand Up @@ -389,7 +389,7 @@ for more configuration examples.

[[webflux-view-httpmessagewriter]]
== JSON and XML
[.small]#<<web.adoc#mvc-view-jackson, Same as in Spring MVC>>#
[.small]#<<web.adoc#mvc-view-jackson, Web MVC>>#

For <<webflux-multiple-representations>> purposes, it is useful to be able to alternate
between rendering a model with an HTML template or as other formats (such as JSON or XML),
Expand Down

0 comments on commit 5a552f1

Please sign in to comment.