我在运行时从applicationContext
创建了一个子上下文,但是它无法共享请求(HttpServletRequest
):
this.integrationContext = new GenericApplicationContext();
Resource xmlSource = new ByteArrayResource(integrationDefinition.getIntegrationXml().getBytes());
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(this.integrationContext);
reader.loadBeanDefinitions(xmlSource);
this.integrationContext.setParent(applicationContext);
this.integrationContext.getBeanFactory().registerSingleton("request", request);
this.integrationContext.refresh();
我想注册它,但是以这种方式,它丢失了会话。如何注册整个请求或获取会话?谢谢。