Skip to content

Commit 1b9ed88

Browse files
aspect_before
1 parent b506fbe commit 1b9ed88

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,16 @@
9797
<groupId>net.sf.ehcache</groupId>
9898
<artifactId>ehcache</artifactId>
9999
</dependency>
100+
<!--java mail的依赖-->
100101
<dependency>
101-
<!--java mail的依赖-->
102102
<groupId>org.springframework.boot</groupId>
103103
<artifactId>spring-boot-starter-mail</artifactId>
104104
</dependency>
105+
<!--aop的依赖-->
106+
<dependency>
107+
<groupId>org.springframework.boot</groupId>
108+
<artifactId>spring-boot-starter-aop</artifactId>
109+
</dependency>
105110
</dependencies>
106111

107112
<build>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.aspect;
2+
3+
import org.aspectj.lang.annotation.Aspect;
4+
import org.aspectj.lang.annotation.Before;
5+
import org.springframework.stereotype.Component;
6+
7+
/**
8+
* Created by zhuzhengping on 2017/3/19.
9+
*/
10+
@Aspect
11+
@Component
12+
public class HttpAspect {
13+
14+
@Before("execution(public * com.controller.*(..))")
15+
public void log(){
16+
System.out.println("this is the aspect before every requset!!!!");
17+
}
18+
}

0 commit comments

Comments
 (0)