Spring AOP failed to configure when a request to the controller was blocked

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.