spring中aop层比如before方法返回的参数传给切点吗
展开全部
定义切面(包含五种通知):
[java] view plain copy
import org.aspectj.lang.ProceedingJoinPoint;
public class MyXmlServiceAop {
public void beforeHandler(String name, int age) {
System.out.println("前置通知:" + name + ":age=" + age);
}
public void aroundHandler(ProceedingJoinPoint jointPoint) {
try {
System.out.println("环绕通知开始");
String name = (String) jointPoint.proceed();
jointPoint.proceed();
System.out.println(name + "环绕通知结束");
} catch (Throwable e) {
}
[java] view plain copy
import org.aspectj.lang.ProceedingJoinPoint;
public class MyXmlServiceAop {
public void beforeHandler(String name, int age) {
System.out.println("前置通知:" + name + ":age=" + age);
}
public void aroundHandler(ProceedingJoinPoint jointPoint) {
try {
System.out.println("环绕通知开始");
String name = (String) jointPoint.proceed();
jointPoint.proceed();
System.out.println(name + "环绕通知结束");
} catch (Throwable e) {
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询