1
内特定的切入点,我开始与原来的问题上 Need help creating a specific pointcut that utilizes a value from a method annotation需要帮助建立的方法
我决定,我想问一个问题,以改变我采用的方法。 我有一个方法(导航),该方法内有一个调用另一个方法,我希望有@Around建议。
@RequestMapping(method = RequestMethod.GET)
public String navigation(ModelMap model) {
...
// Call Auto Handling
logger.info("Call AutoHandling");
this.processAutoHandling(callSession, FunctionalArea.PRE_MAIN_MENU);
}
...
return forward(returnView);
}
这是可能的,因为我似乎无法得到这个工作,如果方法是在同一类内。
这工作,如果它不是对对象本身:
@Around("execution(* *.processAutoHandling(..)) &&" +
"args(callSession, functionalArea) && " +
"args(functionalArea) && " +
"target(bean)"
)
public Object processAutoHandlingCall2(ProceedingJoinPoint jp,
CallSession callSession,
FunctionalArea functionalArea,
Object bean)
throws Throwable {
logger.debug("processAutoHandleCall");
return jp.proceed();
}
通过此调用在我的控制器:中
autoHandlingComponent.processAutoHandling(callSession, FunctionalArea.PRE_MAIN_MENU);
代替
this.processAutoHandling(callSession, FunctionalArea.PRE_MAIN_MENU);