我有以下方法需要幫助創建從一個方法的註釋
@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