How to define Servlet filter order of execution in Spring Boot application - Stack Overflow
Spring Boot sorts your FilterRegistrationBean
using AnnotationAwareOrderComparator
before applying them to the servlet context. The RegistrationBean
is not currently Ordered
so there is no way to set the order by calling a method, but you can work around that by creating subclasses and adding @Order
to them. I think making the base class Ordered
and providing a setter is probably a useful thing to do in the framework (open an issue on github if you agree).
Update: Ordered
was added in 1.0.x.
Read full article from How to define Servlet filter order of execution in Spring Boot application - Stack Overflow
No comments:
Post a Comment