Skip to content

Commit d5a2bde

Browse files
committed
Improve Javadoc for @ControllerAdvice regarding ordering
Closes gh-23163
1 parent 6cc6abd commit d5a2bde

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

spring-web/src/main/java/org/springframework/web/bind/annotation/ControllerAdvice.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,15 @@
3232
* {@link ModelAttribute @ModelAttribute} methods to be shared across
3333
* multiple {@code @Controller} classes.
3434
*
35-
* <p>Classes with {@code @ControllerAdvice} can be declared explicitly as Spring
36-
* beans or auto-detected via classpath scanning. All such beans are sorted based
37-
* on {@link org.springframework.core.Ordered Ordered},
38-
* {@link org.springframework.core.annotation.Order @Order}, and
39-
* {@link javax.annotation.Priority @Priority} (in that order of precedence),
40-
* and applied in that order at runtime. For handling exceptions, an
35+
* <p>Classes annotated with {@code @ControllerAdvice} can be declared explicitly
36+
* as Spring beans or auto-detected via classpath scanning. All such beans are
37+
* sorted based on {@link org.springframework.core.Ordered Ordered} /
38+
* {@link org.springframework.core.PriorityOrdered PriorityOrdered} semantics or
39+
* {@link org.springframework.core.annotation.Order @Order} /
40+
* {@link javax.annotation.Priority @Priority} declarations, with {@code Ordered} /
41+
* {@code PriorityOrdered} semantics taking precedence over {@code @Order} /
42+
* {@code @Priority} declarations. {@code @ControllerAdvice} beans are then
43+
* applied in that order at runtime. For handling exceptions, an
4144
* {@code @ExceptionHandler} will be picked on the first advice with a matching
4245
* exception handler method. For model attributes and {@code InitBinder}
4346
* initialization, {@code @ModelAttribute} and {@code @InitBinder} methods will

0 commit comments

Comments
 (0)