@@ -209,7 +209,6 @@ If an application context hierarchy is not required, applications may configure
209
209
210
210
211
211
212
-
213
212
[[mvc-servlet-special-bean-types]]
214
213
=== Special Bean Types
215
214
[.small]#<<web-reactive.adoc#webflux-special-bean-types,Same in Spring WebFlux>>#
@@ -575,7 +574,7 @@ view technologies.
575
574
==== Redirect
576
575
577
576
The special `redirect:` prefix in a view name allows you to perform a redirect. The
578
- `UrlBasedViewResolver` (and sub-classes ) will recognize this as a special indication that a
577
+ `UrlBasedViewResolver` (and subclasses ) will recognize this as a special indication that a
579
578
redirect is needed. The rest of the view name will be treated as the redirect URL.
580
579
581
580
The net effect is the same as if the controller had returned a `RedirectView`, but now
@@ -592,7 +591,7 @@ value takes precedence over the response status set by `RedirectView`.
592
591
==== Forward
593
592
594
593
It is also possible to use a special `forward:` prefix for view names that are
595
- ultimately resolved by `UrlBasedViewResolver` and sub-classes . This creates an
594
+ ultimately resolved by `UrlBasedViewResolver` and subclasses . This creates an
596
595
`InternalResourceView` which does a `RequestDispatcher.forward()`.
597
596
Therefore, this prefix is not useful with `InternalResourceViewResolver` and
598
597
`InternalResourceView` (for JSPs) but it can be helpful if using another view
@@ -1351,7 +1350,6 @@ default it is set to `true`.
1351
1350
1352
1351
[TIP]
1353
1352
====
1354
-
1355
1353
The MVC Java config and the MVC namespace both provide options for enabling the use of
1356
1354
matrix variables.
1357
1355
@@ -2593,7 +2591,6 @@ for more details.
2593
2591
2594
2592
[TIP]
2595
2593
====
2596
-
2597
2594
What happens when a model attribute name is not explicitly specified? In such cases a
2598
2595
default name is assigned to the model attribute based on its type. For example if the
2599
2596
method returns an object of type `Account`, the default name used is "account". You can
@@ -2739,7 +2736,7 @@ You can also expand and encode using individual URI components:
2739
2736
.encode();
2740
2737
----
2741
2738
2742
- In a Servlet environment the `ServletUriComponentsBuilder` sub-class provides static
2739
+ In a Servlet environment the `ServletUriComponentsBuilder` subclass provides static
2743
2740
factory methods to copy available URL information from a Servlet requests:
2744
2741
2745
2742
[source,java,indent=0]
@@ -2962,7 +2959,7 @@ error content to the body of the response.
2962
2959
2963
2960
You can do that with `@ExceptionHandler` methods. When declared within a controller such
2964
2961
methods apply to exceptions raised by `@RequestMapping` methods of that controller (or
2965
- any of its sub-classes ). You can also declare an `@ExceptionHandler` method within an
2962
+ any of its subclasses ). You can also declare an `@ExceptionHandler` method within an
2966
2963
`@ControllerAdvice` class in which case it handles exceptions from `@RequestMapping`
2967
2964
methods from many controllers. Below is an example of a controller-local
2968
2965
`@ExceptionHandler` method:
@@ -2989,6 +2986,16 @@ is thrown that matches one of the types in the list, then the method annotated w
2989
2986
matching `@ExceptionHandler` will be invoked. If the annotation value is not set then
2990
2987
the exception types listed as method arguments are used.
2991
2988
2989
+ [TIP]
2990
+ ====
2991
+ For `@ExceptionHandler` methods, a root exception match will be preferred to just
2992
+ matching a cause of the current exception, among the handler methods of a particular
2993
+ controller or advice bean. However, a cause match on a higher-priority `@ControllerAdvice`
2994
+ will still be preferred to a any match (whether root or cause level) on a lower-priority
2995
+ advice bean. As a consequence, when using a multi-advice arrangement, please declare your
2996
+ primary root exception mappings on a prioritized advice bean with a corresponding order!
2997
+ ====
2998
+
2992
2999
Much like standard controller methods annotated with a `@RequestMapping` annotation, the
2993
3000
method arguments and return values of `@ExceptionHandler` methods can be flexible. For
2994
3001
example, the `HttpServletRequest` can be accessed in Servlet environments. The return
@@ -3341,7 +3348,7 @@ the response.
3341
3348
[[mvc-ann-async-sse]]
3342
3349
=== Server-Sent Events
3343
3350
3344
- `SseEmitter` is a sub-class of `ResponseBodyEmitter` providing support for
3351
+ `SseEmitter` is a subclass of `ResponseBodyEmitter` providing support for
3345
3352
http://www.w3.org/TR/eventsource/[Server-Sent Events].
3346
3353
Server-sent events is a just another variation on the same "HTTP Streaming"
3347
3354
technique except events pushed from the server are formatted according to
@@ -3696,12 +3703,10 @@ then resolved into the `/WEB-INF/jsp/registration.jsp` view by the
3696
3703
3697
3704
[TIP]
3698
3705
====
3699
-
3700
3706
You do not need to define a `DefaultRequestToViewNameTranslator` bean explicitly. If you
3701
3707
like the default settings of the `DefaultRequestToViewNameTranslator`, you can rely on
3702
3708
the Spring Web MVC `DispatcherServlet` to instantiate an instance of this class if one
3703
3709
is not explicitly configured.
3704
-
3705
3710
====
3706
3711
3707
3712
Of course, if you need to change the default settings, then you do need to configure
0 commit comments