继承MethodBeforeAdvice
我正在看书,里面的代码如下:
package com.java.chapter23;
import org.aspectj.apache.bcel.classfile.Method;
import org.springframework.aop.MethodBeforeAdvice;
public class BeforeAdvice1 implements MethodBeforeAdvice { <--出错行
public void before(Method method, Object[] args , Object target) throws Throwable {
System.out.println("before Advice:" + target.getClass().getName() + "." + method.getName() + " 参数值:" + args[0]);
if (method.getName().equals("getHello")) {
args[0] = "超人";
}
}
}
提示BeforeAdvice1那里出错,提示如下:
The type BeforeAdvice1 must implement the inherited abstract method
MethodBeforeAdvice.before(Method, Object[], Object)
请问为什么?谢谢
package com.java.chapter23;
import org.aspectj.apache.bcel.classfile.Method;
import org.springframework.aop.MethodBeforeAdvice;
public class BeforeAdvice1 implements MethodBeforeAdvice { <--出错行
public void before(Method method, Object[] args , Object target) throws Throwable {
System.out.println("before Advice:" + target.getClass().getName() + "." + method.getName() + " 参数值:" + args[0]);
if (method.getName().equals("getHello")) {
args[0] = "超人";
}
}
}
提示BeforeAdvice1那里出错,提示如下:
The type BeforeAdvice1 must implement the inherited abstract method
MethodBeforeAdvice.before(Method, Object[], Object)
请问为什么?谢谢
...全文
相关推荐
spring_AOP的MethodBeforeAdvice详解
spring_AOP的MethodBeforeAdvice详
Spring中MethodBeforeAdvice,AfterReturningAdvice类对消息的管理和使用
Spring中对消息机制的使用,我们首先使用继承类的方法完成 通过使用idea工具下的Maven聚合项目方式来编写的案例 项目整体架构 最后一个junit的方式测试类 package com.zxf; import com.zxf.demo.Demo1; import com.zxf.demo.Demo2; import org.junit.Test; import org.springframework.context.ApplicationContext; import org.springframework.context.suppor
Spring的动态代理开发.docx
Spring的动态代理开发.docx
使用使用切面的方式记录日志springMvc + hibernate
原来对于spring AOP这一块不是很清楚,这次通过这个练习算是又进一步的了解了一下
Spring Aop
主要是讲述spring 中的Aop的方法及其效果和用途


Web 开发
