0
点赞
收藏
分享

微信扫一扫

Java反射获取不到注解


在CGlib动态代理的情况下


method.getAnnotation(PostMapping.class);


这样是获取不到注解的.

需要用Spring自带的工具类来获取:


AnnotationUtils.findAnnotation(method, PostMapping.class);

举报

相关推荐

0 条评论