直接上代码: @Aspect // for aop @Component // for auto scan @Order(0) // execute before @Transactional public class MessageInterceptor { @Autowired private UserService userService; private static Logger logger = LoggerFactory.getLogger(MessageInterceptor.c
AOP https://en.wikipedia.org/wiki/Aspect-oriented_programming Typically, an aspect is scattered or tangled as code, making it harder to understand and maintain. It is scattered by virtue of the function (such as logging) being spread over a number of
http://www.codeproject.com/Articles/1080517/Aspect-Oriented-Programming-using-Interceptors-wit Download sample application (or see the latest on Github) Contents Introduction What is Aspect Oriented Programming (AOP) and Method Interception? Manual W