Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
694 views
in Technique[技术] by (71.8m points)

spring - Order of ControllerAdvice when both are set to Highest Precedence

My Spring Boot Rest Application uses a library that unfortunately provides a Controller Advice that is set with @Order(Ordered.HIGHEST_PRECEDENCE).

I noticed that I can extend this class and likewise set it locally to @Order(Ordered.HIGHEST_PRECEDENCE) and my class apparently takes precedence as observed from testing. My question is whether this order is guaranteed, i.e. will Spring set locally defined ordered classes at higher precedence than those in imported libraries even though they are defined to have the same order?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...