[英]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.