bean.xml    
<!-- spring关于AOP面向切面编程的配置 -->
    <bean id="logInterceptor" class="thomas.aop.LogInterceptor"></bean>
    <aop:config>
    <aop:pointcut id="bussinessService" expression="execution(public * thomas.service.*.*(..))"/>
    <aop:aspect id="logAspect" ref="logInterceptor">
     <!-- <aop:before method="before" pointcut-ref="bussinessService"/>  -->
     <aop:around method="aroundMethod" pointcut-ref="bussinessService"/>
    </aop:aspect>
    </aop:config> import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;import thomas.log.Logger;//@Aspect
//@Component
public class LogInterceptor {
//@Pointcut("execution(public * com.bjsxt.service..*.add(..))")
public void myMethod(){};

//@Before("myMethod()")
public void before() {
System.out.println("method before");
}

//@Around("myMethod()")
public Object aroundMethod(ProceedingJoinPoint pjp) throws Throwable {
Logger.info("oooOO Class: " + pjp.getTarget() + " | method: " + pjp.getSignature().getName() + "  Start");
Object obj = pjp.proceed();
Logger.info("oooOO Class: " + pjp.getTarget() + " | method: " + pjp.getSignature().getName() + "  End");
return obj;
}

}
web.xml
    <context-param>
       <param-name>contextConfigLocation</param-name>
       <param-value>classpath:beans.xml</param-value>
    </context-param>