我有以下方法需要帮助创建从一个方法的注释
@AutoHandling(slot = FunctionalArea.PRE_MAIN_MENU)
@RequestMapping(method = RequestMethod.GET)
public String navigation(ModelMap model) {
logger.debug("navigation");
...
//First time to the Main Menu and ID-Level is ID-1 or greater
if (!callSession.getCallFlowData().isMainMenuPlayed()
&& callSession.getCallFlowData().getIdLevel() >= 1) {
// Call Auto Handling
logger.info("Call AutoHandling");
autoHandlingComponent.processAutoHandling();
}
...
return forward(returnView);
}
基本上就是我想要做的,就是对processAutoHandling() 一个切入点,但在@After利用价值的特定切入点,我需要使用的插槽()用于@AutoHandling
我尝试这样做,但它不会被调用
@Pointcut("execution(* *.processAutoHandling())")
public void processAutoHandleCall() {
logger.debug("processAutoHandleCall");
}
@Around("processAutoHandleCall() &&" +
"@annotation(autoHandling) &&" +
"target(bean) "
)
public Object processAutoHandlingCall(ProceedingJoinPoint jp,
AutoHandling autoHandling,
Object bean)
throws Throwable {
...
那我可以在实际的呼叫添加注释吗? – 2011-01-21 15:10:12
@Mick你不能注释一个方法调用,但你可以注释processAutoHandling()方法。 – 2011-01-21 15:19:16