spring aop中引介拦截器的用法 |
您所在的位置:网站首页 › springboot拦截器不起作用 › spring aop中引介拦截器的用法 |
spring aop中引介拦截器的用法
原创
mb645b608370ff5 2023-05-11 11:21:18 博主文章分类:sping ©著作权 文章标签 System 文章分类 JavaScript 前端开发 ©著作权归作者所有:来自51CTO博客作者mb645b608370ff5的原创作品,请联系作者获取转载授权,否则将追究法律责任 public class Other implements IntroductionInterceptor,IOther{ public void doOther(){ System.out.println("Other对象的功能"); } public Object invoke(MethodInvocation methodInvocation) throws Throwable { if(implementsInterface(methodInvocation.getMethod().getDeclaringClass())){ return methodInvocation.getMethod().invoke(this, methodInvocation.getArguments()); } else{ return methodInvocation.proceed(); } } public boolean implementsInterface(Class arg0){ boolean assignableFrom = arg0.isAssignableFrom(IOther.class); return assignableFrom; } }
赞 收藏 评论 分享 举报 上一篇:redis使用场景介绍 下一篇:spring aop中targetSource的理解 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |