[英]Spring AOP: Getting return types in after-returning method
我试图在 Spring AOP 中实现after-returning
并且基本实现工作正常:
public void afterExecution(JoinPoint jp){
System.out.println("Returning");
System.out.println("Returning from: " + jp.toString());
// How to get the return type object here?
}
如何获取上述方法中的返回类型对象?
这是我在上下文 xml 文件中添加的内容:
<aop:pointcut id="emplRet" expression="execution(java.lang.String com.model.Employee.get*())"/>
<aop:aspect ref="aspect">
<aop:after-returning pointcut-ref="emplRet" method="afterExecution"/>
</aop:aspect>
请指教。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.