Restore sub-section headings in web content

Headings are optimized for how they appear in the left-hand side
navitation menu, with context provided by parent headings, and not
necessarily for how they read on their own.

At 2nd and 3rd level of nesting, which is where most headings are,
the wrapping becomes too distracting and the left-hand side navigation
sprawling.
This commit is contained in:
Rossen Stoyanchev
2018-10-05 15:54:38 -04:00
parent 1489457025
commit 4d24503317
10 changed files with 57 additions and 57 deletions

View File

@@ -73,7 +73,7 @@ To learn more from the source or to make advanced customizations, see:
[[webflux-cors-controller]]
== Using `@CrossOrigin`
== `@CrossOrigin`
[.small]#<<web.adoc#mvc-cors-controller,Same as in Spring MVC>>#
The {api-spring-framework}/web/bind/annotation/CrossOrigin.html[`@CrossOrigin`]

View File

@@ -85,7 +85,7 @@ and `Mono`. For more on that, see
[[webflux-fn-request]]
=== Using `ServerRequest`
=== `ServerRequest`
`ServerRequest` provides access to the HTTP method, URI, headers, and query parameters,
while access to the body is provided through the `body` methods.
@@ -152,7 +152,7 @@ Flux<Part> parts = request.body(BodyExtractos.toParts());
[[webflux-fn-response]]
=== Using `ServerResponse`
=== `ServerResponse`
`ServerResponse` provides access to the HTTP response and, since it is immutable, you can use
a `build` method to create it. You can use the builder to set the response status, to add response
@@ -246,7 +246,7 @@ found. If it is not found, we use `switchIfEmpty(Mono<T>)` to return a 404 Not F
[[webflux-fn-router-functions]]
== Using `RouterFunction`
== `RouterFunction`
`RouterFunction` is used to route requests to a `HandlerFunction`. Typically, you do not
write router functions yourself, but rather use
@@ -257,7 +257,7 @@ and that would translate to a 404 (Not Found) response.
[[webflux-fn-predicates]]
=== Using Predicates
=== Predicates
You can write your own `RequestPredicate`, but the `RequestPredicates` utility class
offers commonly used implementations, based on the request path, HTTP method, content-type,
@@ -395,7 +395,7 @@ public class WebConfig implements WebFluxConfigurer {
[[webflux-fn-handler-filter-function]]
== Using `HandlerFilterFunction`
== `HandlerFilterFunction`
You can filter routes mapped by a router function by calling
`RouterFunction.filter(HandlerFilterFunction)`, where `HandlerFilterFunction` is essentially a

View File

@@ -242,7 +242,7 @@ shows:
[[webflux-client-retrieve]]
== Using `retrieve()`
== `retrieve()`
The `retrieve()` method is the easiest way to get a response body and decode it.
The following example shows how to do so:
@@ -295,7 +295,7 @@ as the following example shows:
[[webflux-client-exchange]]
== Using `exchange()`
== `exchange()`
The `exchange()` method provides more control than the `retrieve` method. The following example is equivalent
to `retrieve()` but also provides access to the `ClientResponse`:

View File

@@ -75,7 +75,7 @@ Then you can map it to a URL and add a `WebSocketHandlerAdapter`, as the followi
[[webflux-websockethandler]]
=== Using `WebSocketHandler`
=== `WebSocketHandler`
The `handle` method of `WebSocketHandler` takes `WebSocketSession` and returns `Mono<Void>`
to indicate when application handling of the session is complete. The session is handled

View File

@@ -309,7 +309,7 @@ The reactive core also includes <<webflux-codecs>> for client and server side us
[[webflux-httphandler]]
=== Using `HttpHandler`
=== `HttpHandler`
{api-spring-framework}/http/server/reactive/HttpHandler.html[HttpHandler]
is a simple contract with a single method to handle a request and response. It is
@@ -435,7 +435,7 @@ that as a `Servlet`.
[[webflux-web-handler-api]]
=== Using the `WebHandler` API
=== `WebHandler` API
The WebHandler API is a general-purpose server web API for processing requests through a
chain of {api-spring-framework}/web/server/WebExceptionHandler.html[`WebExceptionHandler`] and
@@ -671,7 +671,7 @@ readers and writers for form data, multipart requests, and server-sent events.
[[webflux-codecs-jackson]]
==== Using Jackson
==== Jackson JSON
The decoder relies on Jackson's non-blocking, byte-array parser to parse a stream of byte
chunks into a `TokenBuffer` stream, which can then be turned into objects with Jackson's
@@ -794,7 +794,7 @@ WebClient webClient = WebClient.builder()
[[webflux-dispatcher-handler]]
== Using `DispatcherHandler`
== `DispatcherHandler`
[.small]#<<web.adoc#mvc-servlet,Same as in Spring MVC>>#
Spring WebFlux, similarly to Spring MVC, is designed around the front controller pattern, where a
@@ -1076,7 +1076,7 @@ In the preceding example, the method returns a `String` to be written to the res
[[webflux-ann-controller]]
=== Using `@Controller`
=== `@Controller`
[.small]#<<web.adoc#mvc-ann-controller,Same as in Spring MVC>>#
You can define controller beans by using a standard Spring bean definition.
@@ -1519,7 +1519,7 @@ and others) and is equivalent to `required=false`.
| `@RequestBody`
| For access to the HTTP request body. Body content is converted to the declared method
argument type byusing `HttpMessageReader` instances. Supports reactive types.
argument type by using `HttpMessageReader` instances. Supports reactive types.
See <<webflux-ann-requestbody>>.
| `HttpEntity<B>`
@@ -1757,7 +1757,7 @@ To get all matrix variables, use a `MultiValueMap`, as the following example sho
[[webflux-ann-requestparam]]
==== Using `@RequestParam`
==== `@RequestParam`
[.small]#<<web.adoc#mvc-ann-requestparam,Same as in Spring MVC>>#
You can use the `@RequestParam` annotation to bind query parameters to a method argument in a
@@ -1813,7 +1813,7 @@ with `@RequestParam`.
[[webflux-ann-requestheader]]
==== Using `@RequestHeader`
==== `@RequestHeader`
[.small]#<<web.adoc#mvc-ann-requestheader,Same as in Spring MVC>>#
You can use the `@RequestHeader` annotation to bind a request header to a method argument in a
@@ -1866,7 +1866,7 @@ example, a method parameter annotated with `@RequestHeader("Accept")` may be of
[[webflux-ann-cookievalue]]
==== Using `@CookieValue`
==== `@CookieValue`
[.small]#<<web.adoc#mvc-ann-cookievalue,Same as in Spring MVC>>#
You can use the `@CookieValue` annotation to bind the value of an HTTP cookie to a method argument
@@ -1902,7 +1902,7 @@ Type conversion is applied automatically if the target method parameter type is
[[webflux-ann-modelattrib-method-args]]
==== Using `@ModelAttribute`
==== `@ModelAttribute`
[.small]#<<web.adoc#mvc-ann-modelattrib-method-args,Same as in Spring MVC>>#
You can use the `@ModelAttribute` annotation on a method argument to access an attribute from the
@@ -2010,7 +2010,7 @@ with `@ModelAttribute`.
[[webflux-ann-sessionattributes]]
==== Using `@SessionAttributes`
==== `@SessionAttributes`
[.small]#<<web.adoc#mvc-ann-sessionattributes,Same as in Spring MVC>>#
`@SessionAttributes` is used to store model attributes in the `WebSession` between
@@ -2067,7 +2067,7 @@ as the following example shows:
[[webflux-ann-sessionattribute]]
==== Using `@SessionAttribute`
==== `@SessionAttribute`
[.small]#<<web.adoc#mvc-ann-sessionattribute,Same as in Spring MVC>>#
If you need access to pre-existing session attributes that are managed globally
@@ -2095,7 +2095,7 @@ workflow, consider using `SessionAttributes`, as described in
[[webflux-ann-requestattrib]]
==== Using `@RequestAttribute`
==== `@RequestAttribute`
[.small]#<<web.adoc#mvc-ann-requestattrib,Same as in Spring MVC>>#
Similarly to `@SessionAttribute`, you can use the `@RequestAttribute` annotation to
@@ -2261,7 +2261,7 @@ To access multipart data sequentially, in streaming fashion, you can use `@Reque
[[webflux-ann-requestbody]]
==== Using `@RequestBody`
==== `@RequestBody`
[.small]#<<web.adoc#mvc-ann-requestbody,Same as in Spring MVC>>#
You can use the `@RequestBody` annotation to have the request body read and deserialized into an
@@ -2318,7 +2318,7 @@ example uses a `BindingResult` argument`:
[[webflux-ann-httpentity]]
==== Using `HttpEntity`
==== `HttpEntity`
[.small]#<<web.adoc#mvc-ann-httpentity,Same as in Spring MVC>>#
`HttpEntity` is more or less identical to using <<webflux-ann-requestbody>> but is based on a
@@ -2339,7 +2339,7 @@ container object that exposes request headers and the body. The following exampl
[[webflux-ann-responsebody]]
==== Using `@ResponseBody`
==== `@ResponseBody`
[.small]#<<web.adoc#mvc-ann-responsebody,Same as in Spring MVC>>#
You can use the `@ResponseBody` annotation on a method to have the return serialized to the
@@ -2375,7 +2375,7 @@ configure or customize message writing.
[[webflux-ann-responseentity]]
==== Using `ResponseEntity`
==== `ResponseEntity`
[.small]#<<web.adoc#mvc-ann-responseentity,Same as in Spring MVC>>#
Using `ResponseEntity` is more or less identical to using <<webflux-ann-responsebody>> but is based
@@ -2460,7 +2460,7 @@ controller method. Use a composite interface if you need to activate multiple vi
[[webflux-ann-modelattrib-methods]]
=== Using a Model
=== `Model`
[.small]#<<web.adoc#mvc-ann-modelattrib-methods,Same as in Spring MVC>>#
You can use the `@ModelAttribute` annotation:
@@ -2564,7 +2564,7 @@ as the following example shows:
[[webflux-ann-initbinder]]
=== Using `DataBinder`
=== `DataBinder`
[.small]#<<web.adoc#mvc-ann-initbinder,Same as in Spring MVC>>#
`@Controller` or `@ControllerAdvice` classes can have `@InitBinder` methods, to
@@ -2923,7 +2923,7 @@ gain full control over the configuration through the
[[webflux-config-enable]]
=== Enabling WebFlux Configuration
=== Enabling WebFlux Config
[.small]#<<web.adoc#mvc-config-enable,Same as in Spring MVC>>#
You can use the `@EnableWebFlux` annotation in your Java config, as the following example shows:

View File

@@ -6,7 +6,7 @@ This section describes options for client-side access to REST endpoints.
[[webmvc-resttemplate]]
== Using `RestTemplate`
== `RestTemplate`
`RestTemplate` is a synchronous client to perform HTTP requests. It is the original
Spring REST client and exposes a simple, template-method API over underlying HTTP client
@@ -22,7 +22,7 @@ See <<integration.adoc#rest-client-access,REST Endpoints>> for details.
[[webmvc-webclient]]
== Using `WebClient`
== `WebClient`
`WebClient` is a non-blocking, reactive client to perform HTTP requests. It was
introduced in 5.0 and offers a modern alternative to the `RestTemplate`, with efficient

View File

@@ -73,7 +73,7 @@ To learn more from the source or make advanced customizations, check the code be
[[mvc-cors-controller]]
== Using `@CrossOrigin`
== `@CrossOrigin`
[.small]#<<web-reactive.adoc#webflux-cors-controller,Same as in Spring WebFlux>>#
The {api-spring-framework}/web/bind/annotation/CrossOrigin.html[`@CrossOrigin`]

View File

@@ -1777,7 +1777,7 @@ them otherwise in the file names for Tiles definitions.
[[mvc-view-tiles-url]]
==== Using `UrlBasedViewResolver`
==== `UrlBasedViewResolver`
The `UrlBasedViewResolver` instantiates the given `viewClass` for each view it has to
resolve. The following bean defines a `UrlBasedViewResolver`:
@@ -1795,7 +1795,7 @@ resolve. The following bean defines a `UrlBasedViewResolver`:
[[mvc-view-tiles-resource]]
==== Using `ResourceBundleViewResolver`
==== `ResourceBundleViewResolver`
The `ResourceBundleViewResolver` has to be provided with a property file that contains
view names and view classes that the resolver can use. The following example shows a bean
@@ -1836,7 +1836,7 @@ Note that the `TilesView` class supports JSTL (the JSP Standard Tag Library).
[[mvc-view-tiles-preparer]]
==== Using `SimpleSpringPreparerFactory` and `SpringBeanPreparerFactory`
==== `SimpleSpringPreparerFactory` and `SpringBeanPreparerFactory`
As an advanced feature, Spring also supports two special Tiles `PreparerFactory`
implementations. See the Tiles documentation for details on how to use

View File

@@ -284,7 +284,7 @@ provides many extra convenient options.
[[mvc-container-config]]
=== Servlet Configuration
=== Servlet Config
In a Servlet 3.0+ environment, you have the option of configuring the Servlet container
programmatically as an alternative or in combination with a `web.xml` file. The following
@@ -2081,7 +2081,7 @@ to set a `UrlPathHelper` with `removeSemicolonContent=false` through
[[mvc-ann-requestparam]]
==== Using `@RequestParam`
==== `@RequestParam`
[.small]#<<web-reactive.adoc#webflux-ann-requestparam,Same as in Spring WebFlux>>#
You can use the `@RequestParam` annotation to bind Servlet request parameters (that is, query
@@ -2133,7 +2133,7 @@ with `@RequestParam`.
[[mvc-ann-requestheader]]
==== Using `@RequestHeader`
==== `@RequestHeader`
[.small]#<<web-reactive.adoc#webflux-ann-requestheader,Same as in Spring WebFlux>>#
You can use the `@RequestHeader` annotation to bind a request header to a method argument in a
@@ -2186,7 +2186,7 @@ example, a method parameter annotated with `@RequestHeader("Accept")` can be of
[[mvc-ann-cookievalue]]
==== Using `@CookieValue`
==== `@CookieValue`
[.small]#<<web-reactive.adoc#webflux-ann-cookievalue,Same as in Spring WebFlux>>#
You can use the `@CookieValue` annotation to bind the value of an HTTP cookie to a method argument
@@ -2222,7 +2222,7 @@ if the target method parameter type is not
[[mvc-ann-modelattrib-method-args]]
==== Using `@ModelAttribute`
==== `@ModelAttribute`
[.small]#<<web-reactive.adoc#webflux-ann-modelattrib-method-args,Same as in Spring WebFlux>>#
You can use the `@ModelAttribute` annotation on a method argument to access an attribute from the
@@ -2350,7 +2350,7 @@ with `@ModelAttribute`.
[[mvc-ann-sessionattributes]]
==== Using `@SessionAttributes`
==== `@SessionAttributes`
[.small]#<<web-reactive.adoc#webflux-ann-sessionattributes,Same as in Spring WebFlux>>#
`@SessionAttributes` is used to store model attributes in the HTTP Servlet session between
@@ -2407,7 +2407,7 @@ storage, as the following example shows:
[[mvc-ann-sessionattribute]]
==== Using `@SessionAttribute`
==== `@SessionAttribute`
[.small]#<<web-reactive.adoc#webflux-ann-sessionattribute,Same as in Spring WebFlux>>#
If you need access to pre-existing session attributes that are managed globally
@@ -2438,7 +2438,7 @@ workflow, consider using `@SessionAttributes` as described in
[[mvc-ann-requestattrib]]
==== Using `@RequestAttribute`
==== `@RequestAttribute`
[.small]#<<web-reactive.adoc#webflux-ann-requestattrib,Same as in Spring WebFlux>>#
Similar to `@SessionAttribute`, you can use the `@RequestAttribute` annotations to
@@ -2689,7 +2689,7 @@ public String handle(**@Valid** @RequestPart("meta-data") MetaData metadata,
[[mvc-ann-requestbody]]
==== Using `@RequestBody`
==== `@RequestBody`
[.small]#<<web-reactive.adoc#webflux-ann-requestbody,Same as in Spring WebFlux>>#
You can use the `@RequestBody` annotation to have the request body read and deserialized into an
@@ -2751,7 +2751,7 @@ container object that exposes request headers and body. The following listing sh
[[mvc-ann-responsebody]]
==== Using `@ResponseBody`
==== `@ResponseBody`
[.small]#<<web-reactive.adoc#webflux-ann-responsebody,Same as in Spring WebFlux>>#
You can use the `@ResponseBody` annotation on a method to have the return serialized to the
@@ -2971,7 +2971,7 @@ the model attribute name, as the following example shows:
[[mvc-ann-initbinder]]
=== Using `DataBinder`
=== `DataBinder`
[.small]#<<web-reactive.adoc#webflux-ann-initbinder,Same as in Spring WebFlux>>#
`@Controller` or `@ControllerAdvice` classes can have `@InitBinder` methods that
@@ -3559,7 +3559,7 @@ controller methods and provide basic support for a single asynchronous return va
[[mvc-ann-async-deferredresult]]
=== Using `DeferredResult`
=== `DeferredResult`
[.small]#<<mvc-ann-async-vs-webflux,Compared to WebFlux>>#
Once the asynchronous request processing feature is
@@ -3590,7 +3590,7 @@ example, in response to an external event (JMS message), a scheduled task, or ot
[[mvc-ann-async-callable]]
=== Using `Callable`
=== `Callable`
[.small]#<<mvc-ann-async-vs-webflux,Compared to WebFlux>>#
A controller can wrap any supported return value with `java.util.concurrent.Callable`,
@@ -3989,7 +3989,7 @@ This section describes the HTTP caching-related options that are available in Sp
[[mvc-caching-cachecontrol]]
=== Using `CacheControl`
=== `CacheControl`
[.small]#<<web-reactive.adoc#webflux-caching-cachecontrol,Same as in Spring WebFlux>>#
{api-spring-framework}/http/CacheControl.html[`CacheControl`] provides support for
@@ -4182,7 +4182,7 @@ available on the classpath (for example, payload converters for JSON, XML, and o
[[mvc-config-customize]]
=== The MVC Configuration API
=== MVC Config API
[.small]#<<web-reactive.adoc#webflux-config-customize,Same as in Spring WebFlux>>#
In Java configuration, you can implement the `WebMvcConfigurer` interface, as the
@@ -4952,7 +4952,7 @@ The following example shows how to achieve the same configuration in XML:
[[mvc-config-advanced-java]]
=== Advanced Java Configuration
=== Advanced Java Config
[.small]#<<web-reactive.adoc#webflux-config-advanced-java,Same as in Spring WebFlux>>#
`@EnableWebMvc` imports `DelegatingWebMvcConfiguration`, which:
@@ -4984,7 +4984,7 @@ the classpath.
[[mvc-config-advanced-xml]]
=== Advanced XML Configuration
=== Advanced XML Config
The MVC namespace does not have an advanced mode. If you need to customize a property on
a bean that you cannot change otherwise, you can use the `BeanPostProcessor` lifecycle

View File

@@ -23,7 +23,7 @@ server-side applications that handle WebSocket messages.
[[websocket-server-handler]]
=== Using `WebSocketHandler`
=== `WebSocketHandler`
[.small]#<<web-reactive.adoc#webflux-websocket-server-handler,Same as in Spring WebFlux>>#
Creating a WebSocket server is as simple as implementing `WebSocketHandler` or, more
@@ -789,7 +789,7 @@ SockJS endpoint prefix, thus letting Spring's `SockJsService` handle it.
[[websocket-fallback-sockjs-client]]
=== Using `SockJsClient`
=== `SockJsClient`
Spring provides a SockJS Java client to connect to remote SockJS endpoints without
using a browser. This can be especially useful when there is a need for bidirectional
@@ -1265,7 +1265,7 @@ methods, as described in the following topics:
[[websocket-stomp-message-mapping]]
==== Using `@MessageMapping`
==== `@MessageMapping`
You can use `@MessageMapping` to annotate methods that route messages based on their
destination. It is supported at the method level as well as at the type level. At the type
@@ -1349,7 +1349,7 @@ See <<websocket-stomp-handle-send>>.
[[websocket-stomp-subscribe-mapping]]
==== Using `@SubscribeMapping`
==== `@SubscribeMapping`
`@SubscribeMapping` is similar to `@MessageMapping` but narrows the mapping to
subscription messages only. It supports the same
@@ -1403,7 +1403,7 @@ method that is invoked after messages, including subscriptions, have been handle
[[websocket-stomp-exception-handler]]
==== Using `@MessageExceptionHandler`
==== `@MessageExceptionHandler`
An application can use `@MessageExceptionHandler` methods to handle exceptions from
`@MessageMapping` methods. You can declare exceptions in the annotation