1

I have a custom filter I created and added using FilterRegistrationBean. I know that there is an @Order annotation, and you can set the order when registering the filter. However, how do I set the order as last to be executed?

Would it be @Order(0) or @Order(1000000), for example?

Ali Dehghani
  • 46,221
  • 15
  • 164
  • 151
ahrobins
  • 352
  • 2
  • 5
  • 13
  • 4
    Maybe `@Order(Ordered.LOWEST_PRECEDENCE)` http://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/Ordered.html#LOWEST_PRECEDENCE – Ali Dehghani Jun 27 '17 at 16:23
  • Take a look: https://stackoverflow.com/questions/25957879/filter-order-in-spring-boot – Rana_S Jun 27 '17 at 16:29
  • @RossiRobinsion is that saying that lowest precedence gets ran first? And that since spring security filter is assigned lowest precedence it will get ran last unless you register it and set an order for it? So would me setting a filter order not even matter unless I registered the security filter? – ahrobins Jun 27 '17 at 16:36
  • 1
    @ahrobins it is.... "The lower the number, the higher the precedence." – Rana_S Jun 27 '17 at 16:39

0 Answers0