Spring AOP: how to get the annotations of the adviced method

前端 未结 5 1031
我在风中等你
我在风中等你 2020-12-14 21:28

I\'d like to implement declarative security with Spring/AOP and annotations. As you see in the next code sample I have the Restricted Annotations with the paramter \"allowed

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-14 21:57

    I assume @Restricted is your annotation. If that is the case, make sure you have:

    @Retention(RetentionPolicy.RUNTIME)
    

    in your annotation definition. This means that the annotation is retained at runtime.

提交回复
热议问题