!1 修复 AOP的案例,调用/doError时异常不打印
Merge pull request !1 from 海王星Ivan/master
This commit is contained in:
commit
8f146f0389
@ -53,15 +53,14 @@ public class LogAspect {
|
|||||||
|
|
||||||
//环绕通知,环绕增强,相当于MethodInterceptor
|
//环绕通知,环绕增强,相当于MethodInterceptor
|
||||||
@Around("webLog()")
|
@Around("webLog()")
|
||||||
public Object arround(ProceedingJoinPoint pjp) {
|
public Object arround(ProceedingJoinPoint pjp) throws Throwable{
|
||||||
System.out.println("方法环绕start.....");
|
System.out.println("方法环绕start.....");
|
||||||
try {
|
try {
|
||||||
Object o = pjp.proceed();
|
Object o = pjp.proceed();
|
||||||
System.out.println("方法环绕proceed,结果是 :" + o);
|
System.out.println("方法环绕proceed,结果是 :" + o);
|
||||||
return o;
|
return o;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
throw e;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user