Difference between Spring AOP and Interceptor

1. The role level
    interceptor is only responsible for the action, and the role level is generally located in the Controller layer.
    Spring AOP mainly intercepts access to Spring-managed beans. The general role is the same as that of the     Service         layer
. It is one of the implementation methods of AOP, and it is implemented using the proxy mode.     Differences:         1. Interceptors and filters are somewhat similar. They are chained processing modes. This has a disadvantage that each request will access the context of the action, which is not flexible enough          . 2. Spring AOP annotations include @Before, @After, @AfterReturning, @AfterThrowing, @Around , you can configure the beans to be monitored and processed more flexibly




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325370037&siteId=291194637