在CGlib动态代理的情况下
method.getAnnotation(PostMapping.class);
这样是获取不到注解的.
需要用Spring自带的工具类来获取:
AnnotationUtils.findAnnotation(method, PostMapping.class);
微信扫一扫
在CGlib动态代理的情况下
method.getAnnotation(PostMapping.class);
这样是获取不到注解的.
需要用Spring自带的工具类来获取:
AnnotationUtils.findAnnotation(method, PostMapping.class);
相关推荐