Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Won't Fix
-
2.0.8
-
None
-
None
-
spring 2.0.6
Description
org.apache.struts2.spring.StrutsSpringObjectFactory
use root WebApplicationContext now :
.....
boolean useClassCache = "true".equals(useClassCacheStr);
log.info("Initializing Struts-Spring integration...");
org.springframework.context.ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
.....
i think it's better to create a child ApplicationContext, it will be more clearly and it can use specific config( add a constant in struts.xml )
like spring mvc do now:
org.springframework.web.servlet.FrameworkServlet
ConfigurableWebApplicationContext wac = (ConfigurableWebApplicationContext) BeanUtils.instantiateClass(getContextClass());
wac.setParent(parent);
wac.setServletContext(getServletContext());
wac.setServletConfig(getServletConfig());
wac.setNamespace(getNamespace());
if (getContextConfigLocation() != null) {
wac.setConfigLocations(
StringUtils.tokenizeToStringArray(
getContextConfigLocation(), ConfigurableWebApplicationContext.CONFIG_LOCATION_DELIMITERS));
}
wac.refresh();