Simply put, the problem with the parent-child container, Placing the configuration information for AOP in Applicationcontext.xml, which is contextloaderlistener loaded, Spring creates a webapplicationcontext context, called the parent context (the parent container), which is saved in the ServletContext, the key value is Webapplicationcontext.root_web_application_context_attribute. While Spring-mvc.xml is a dispatcherservlet configuration file, such a servlet can be configured with multiple, each Dispatcherservlet has a context object of its own (Webapplicationcontext), called a child context (a child container), which can access the contents of the parent context, but the parent cannot access the content in the child context. It is also stored in the ServletContext, and the key value is the "Org.springframework.web.servlet.FrameworkServlet.CONTEXT" +servlet name. When spring loads the parent container, it will look for the pointcut, but this time the controller is in the child container, the parent container is unable to access the child container, so it cannot be intercepted.
So the interception scan packet code is extracted from the applicationcontent into the Springmvc-servlet configuration file.
Spring AOP failed to configure when a request to the controller was blocked