为了账号安全,请及时绑定邮箱和手机立即绑定

aop没用啊

package com.girl.aspect;


import org.aspectj.lang.annotation.Aspect;

import org.aspectj.lang.annotation.Before;

import org.springframework.stereotype.Component;


@Aspect

@Component

public class HttpAspect {

@Before("execution(public * com.girl.controller.GirlController.*(..))")

public void upup() {

System.out.println(11111111);

}

}


正在回答

4 回答

没问题了,换了台电脑运行就好了,晕。。

0 回复 有任何疑惑可以回复我~

写好重启idea

0 回复 有任何疑惑可以回复我~

https://img1.sycdn.imooc.com//5b6be4630001aa0a08520212.jpg

https://img1.sycdn.imooc.com//5b6be4900001835706060330.jpg

如上图是代码.

https://img1.sycdn.imooc.com//5b6be4bc0001f98c02700256.jpg

上图是包结构。

https://img1.sycdn.imooc.com//5b6be4e500019b9914050205.jpg

控制台信息,只有方法中的输出打印,没有拦截打印。。。


0 回复 有任何疑惑可以回复我~

在postman里触发方法了吗

0 回复 有任何疑惑可以回复我~
#1

慕仔4112815 提问者

触发了啊。。如下图。还是不打印。
2018-08-09 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Spring Boot进阶之Web进阶
  • 参与学习       103852    人
  • 解答问题       393    个

《2小时学习Spring Boot》之进阶教程,针对Web方面的相关技巧

进入课程

aop没用啊

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信