Aspect 用于方法出入口日志记录

@Aspect
public class Aspect
{

    @Before("execution(* com.test.*.*(..))")
    public void logBefore(JoinPoint joinPoint)
    {
        logEnter.....
    }

    @After("execution(* com.test.*.*(..))")
    public void logAfter(JoinPoint joinPoint)
    {
         logExit.....
    }
}


Spring config:
<aop:aspectj-autoproxy/>
	
<bean id="aspect" class="com.test.Aspect"></bean>

备注:
Spring 3.1.0

猜你喜欢

转载自xue88ming.iteye.com/blog/2360758