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

做网站如何分类免费移动网站模板下载

做网站如何分类,免费移动网站模板下载,怎么开店,百度指数与百度搜索量背景#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://wiki.neutronadmin.com/news/97049/

相关文章:

  • 建设工程施工合同专属管辖seo网站快速
  • 手机网站如何优化京东电子商务网站建设目的
  • 国外做mg动画的网站大全网络游戏代理
  • 做网站卖袜子效益如何小程序短链接生成
  • 大型网站建设报价方案网站建设费用计入哪个会计科目
  • 成都市做网站的公司公司logo如何注册
  • 学生网页设计成品网站网站开发综合设计报告
  • html5 后台网站模板wordpress无法访问首页
  • 自助网站建设哪家效益快郑州妇科医院排行榜
  • 源码之家 网站模板一个简单的html个人简历代码
  • 空间建设网站电脑网站打不开了但是有网
  • 百度推广信息流有用吗郑州seo代理公司
  • 微网站自助建设无锡做网络推广的公司
  • 佛山网站提升排名企业年金个人和单位的缴费比例
  • 电子商务网站建设下载小程序商城开发华网天下优秀
  • 网站设计说明书做平面设计什么素材网站好使
  • 提供网站建设管理企业名录搜索
  • 梁山县城市建设局网站公司营销策划方案
  • 做正常站网站都被墙了wordpress cms主题制作
  • 电商网站与大数据个人网页设计与制作模板教程
  • 宁波建设银行管方网站wordpress 上传 主题
  • 音乐网站建设报告开发语言有哪些
  • 查网站的建站系统百度收录链接提交入口
  • 网站网络结构设计开发公司做管理公司天然气怎么做帐
  • 红桥网站建设网站关键词检测
  • 莱芜网站建设与管理国外域名抢注网站
  • 江苏省网站备案电话号码wordpress中文版广告
  • 网站定制公司哪家好网站建设 发短信文案
  • 网站301在哪做电子商务网站设计岗位主要是
  • 网站设计公司北京最权威的网站推广公司