当前位置: 首页 > news >正文

郑州网站推广用一个域名免费做网站

郑州网站推广,用一个域名免费做网站,海外招聘人才网,国外网站404错误页背景#xff1a;课本上是注解和Xml文件混用的方式#xff0c;研究了一下用配置类加注解和测试方法实现各种通知方式的切入。 1.首先dao的接口#xff0c;增删改查 public interface UserDaoAspect {public void add();public void delete();public void update();public vo…背景课本上是注解和Xml文件混用的方式研究了一下用配置类加注解和测试方法实现各种通知方式的切入。 1.首先dao的接口增删改查 public interface UserDaoAspect {public void add();public void delete();public void update();public void select(); } 2.dao的实现类 Repository(UserDaoAspectImpl) public class UserDaoAspectImpl implements UserDaoAspect{Overridepublic void add() {System.out.println(添加用户);}Overridepublic void delete() {System.out.println(删除用户);//int flag 1/0;}Overridepublic void update() {System.out.println(更新用户);}Overridepublic void select() {System.out.println(查询用户);} } 3.切入面和切入点 Component Aspect public class AnnotationAdvice {Pointcut(execution(* com.awei.aop.dao.UserDaoAspectImpl.*(..)))public void pointcut(){}//前置通知Before(pointcut())public void before(JoinPoint joinPoint){System.out.println(执行前置通知);System.out.println(目标类:joinPoint.getTarget());System.out.println(目标类的调用方法joinPoint.getSignature().getName());}//返回通知AfterReturning(pointcut())public void afterReturningTest(JoinPoint joinPoint){System.out.println(执行了返回通知且是无异常时的调用);System.out.println(被织入增强处理的目标方法joinPoint.getSignature().getName());}//环绕通知Around(pointcut())public Object around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {System.out.println(执行了环绕通知前---------------------------------);Object proceed proceedingJoinPoint.proceed();System.out.println(执行了环绕通知后---------------------------------);return proceed;}//异常通知AfterThrowing(pointcut())public void afterException(){System.out.println(执行了异常通知);}//后置通知After(pointcut())public void after(){System.out.println(执行了后置通知);} }4.配置类 Configuration ComponentScan(com.awei.aop) //包扫描 EnableAspectJAutoProxy //开启自动代理 public class AnnotationConfig {} 5.测试方法 public class AopAnitationTest {Testpublic void aopxml(){//基于AnnotationConfigApplicationContext创建ioc容器AnnotationConfigApplicationContext context new AnnotationConfigApplicationContext(AnnotationConfig.class);UserDaoAspect userDaoAspect (UserDaoAspect) context.getBean(UserDaoAspectImpl);userDaoAspect.add();}}运行结果
http://www.zqtcl.cn/news/269802/

相关文章:

  • wordpress 产品目录seo技术是干什么的
  • 做里番网站犯法吗中建八局第一建设有限公司资质
  • 怎么制作网站教程电商seo建站优化价格表
  • 黄平网站建设网站建设公司广告 晴天娃娃
  • 中山市 有限公司网站建设网站建设 福步 2018
  • 英语网站开发中国桥梁建设公司排名
  • php做的网站怎么运行公司网站备案查询
  • jsp 响应式网站模板设计类网站策划案
  • 建设银行网站怎么注销网银百度广告联盟
  • flash建网站教程天津市建设工程评标专家网
  • 合格的网站设计师需要会什么软件seo 深圳
  • 公司网站建设费用账务处理软文300字案例
  • 门户型网站特点网站营销推广的公司
  • wordpress gif主题seo兼职怎么收费
  • 商城免费建站系统手机端首页尺寸多少
  • 网站上存储播放视频怎么做wordpress 作品集 相册
  • 建设网工程信息南昌官网seo厂家
  • 上海网站seo牛巨微网页设计模板html代码个人介绍
  • 网站 架构 设计公司网站建设费怎么做账
  • 合肥电脑网站建站萍乡手机网站建设
  • 优化seo网站西安wordpress 做购物网站
  • 广州建设档案馆网站稿定设计app免费版官方
  • 橙色企业网站源码建设工程投标文件在哪个网站有发布
  • 服务器可以做网站吗深圳高端网站建设创新
  • 企业平台网站建设方案大连网络广告
  • 如何给网站做宣传新手怎么建立自己网站
  • 酒店和网站对接如何做开发网站那个好
  • 北京建设信源咨询有限公司网站快对小程序入口
  • 湖北人工智能建站系统软件城乡建设官网
  • 广东模板建站平台设计网站