文章詳情頁
java - 關于aop在controller不起用的問題
瀏覽:289日期:2023-10-20 11:29:51
問題描述
我想在controller攔截接口的訪問次數,結果都不沒有用,下面是我的代碼
@Component@Aspect@EnableAspectJAutoProxy(proxyTargetClass = true)public class EduAspect { private final static Logger LOGGER = LoggerFactory.getLogger(EduAspect.class); //我想攔截sample包下所有以.Controller結尾的方法,但是攔截不到 @Pointcut('execution(* com.sample..*Controller.*(..))') public void declareLoggerJoinPointExpression() { } @Pointcut('@annotation(com.sample.common.annotation.Frequency)') public void declareFrequencyJoinPoint(){ }
代碼就是上面的這樣,但是好像一直aop不管用,我也開啟了cglib
問題解答
回答1:你這還沒寫完吧.....
你只是聲明了是切入點. 但是沒有通知執行啊.
具體如何配置可詳見; http://docs.spring.io/spring/...
標簽:
java
相關文章:
1. node.js - mongodb查找子對象的名稱為某個值的對象的方法2. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””3. html5 - datatables 加載不出來數據。4. Docker for Mac 創建的dnsmasq容器連不上/不工作的問題5. docker鏡像push報錯6. phpstudy8.1沒集成mysql-front7. javascript - 在 model里定義的 引用表模型時,model為undefined。8. javascript - QQ第三方登錄的問題9. 測試自動化html元素選擇器元素ID或DataAttribute [關閉]10. 利用IPMI遠程安裝centos報錯!
排行榜

網公網安備