提交 d5a2bdee 编写于 作者: S Sam Brannen

Improve Javadoc for @ControllerAdvice regarding ordering

Closes gh-23163
上级 6cc6abd4
......@@ -32,12 +32,15 @@ import org.springframework.stereotype.Component;
* {@link ModelAttribute @ModelAttribute} methods to be shared across
* multiple {@code @Controller} classes.
*
* <p>Classes with {@code @ControllerAdvice} can be declared explicitly as Spring
* beans or auto-detected via classpath scanning. All such beans are sorted based
* on {@link org.springframework.core.Ordered Ordered},
* {@link org.springframework.core.annotation.Order @Order}, and
* {@link javax.annotation.Priority @Priority} (in that order of precedence),
* and applied in that order at runtime. For handling exceptions, an
* <p>Classes annotated with {@code @ControllerAdvice} can be declared explicitly
* as Spring beans or auto-detected via classpath scanning. All such beans are
* sorted based on {@link org.springframework.core.Ordered Ordered} /
* {@link org.springframework.core.PriorityOrdered PriorityOrdered} semantics or
* {@link org.springframework.core.annotation.Order @Order} /
* {@link javax.annotation.Priority @Priority} declarations, with {@code Ordered} /
* {@code PriorityOrdered} semantics taking precedence over {@code @Order} /
* {@code @Priority} declarations. {@code @ControllerAdvice} beans are then
* applied in that order at runtime. For handling exceptions, an
* {@code @ExceptionHandler} will be picked on the first advice with a matching
* exception handler method. For model attributes and {@code InitBinder}
* initialization, {@code @ModelAttribute} and {@code @InitBinder} methods will
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册