摘要: Schena——based AOP 声明 Spring所有的切面和通知器都必须放在一个<aop:config>标签内,可以同时配置多个<aop:config>元素。 每一个<aop:config>内可以包含pointcut、advisor、aspect元素,但是必须按照这3个元素指定顺序进行声明。 阅读全文
posted @ 2019-02-25 17:12 话·醉月 阅读(1563) 评论(0) 推荐(0) 编辑
摘要: 装配方式 方式一:默认 方式二:byName:根据属性名称自动装配。会查找Bean容器内部所有初始化的与属性名成相同的Bean,自动装配。(需要通过set方法注入,注入Bean的id名称需要和实体类的属性名称一致) <?xml version="1.0" encoding="UTF-8"?> <be 阅读全文
posted @ 2019-02-25 16:41 话·醉月 阅读(969) 评论(0) 推荐(0) 编辑
摘要: 背景:Spring 构建单元测试 错误 java.lang.Exception: Test class should have exactly one public constructor at org.junit.runners.BlockJUnit4ClassRunner.validateOnl 阅读全文
posted @ 2019-02-25 16:16 话·醉月 阅读(8268) 评论(0) 推荐(1) 编辑
摘要: 背景:配置spring xml,注释xml中文件元素 错误: Caused by: org.xml.sax.SAXParseException; lineNumber: 24; columnNumber: 10; cvc-complex-type.2.3: 元素 'beans' 必须不含字符 [子级 阅读全文
posted @ 2019-02-25 16:13 话·醉月 阅读(7681) 评论(0) 推荐(0) 编辑
摘要: 背景:学习Spring,在使用注解@Bean的name属性配置<bean>实例时,不能注册实例成功 报错 WARNING: Exception encountered during context initialization - cancelling refresh attempt: org.sp 阅读全文
posted @ 2019-02-25 16:10 话·醉月 阅读(4782) 评论(0) 推荐(0) 编辑
摘要: 背景:学习切面,测试前置通知功能,xml配置如下 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.or 阅读全文
posted @ 2019-02-25 16:01 话·醉月 阅读(3180) 评论(1) 推荐(1) 编辑
摘要: AOP AOP的定义:AOP,Aspect Oriented Programming的缩写,意为面向切面编程,是通过预编译或运行期动态代理实现程序功能处理的统一维护的一种技术 实现方式 预编译 AspectJ 运行期动态代理(JDK动态代理、CGLib动态代理) SpringAOP JbossAOP 阅读全文
posted @ 2019-02-25 11:25 话·醉月 阅读(376) 评论(0) 推荐(0) 编辑