spring有2个容器,一个放controller(位于child),一个放组件(位于parent)
child | WebApplicationContext webApp=RequestContextUtils.getWebApplicationContext(request , request.getSession().getServletContext()); |
parent | ApplicationContext ac1 = WebApplicationContextUtils.getRequiredWebApplicationContext(request.getSession().getServletContext()); |
parent | ApplicationContext ac2 = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext()); |
parent | WebApplicationContext webApplicationContext = (WebApplicationContext) request.getSession().getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); |
parent | WebApplicationContext cc = ContextLoader.getCurrentWebApplicationContext() |