strust2中是如何初始化container并且使其全局单例?
StrutsPrepareAndExecuteFilter
protected PrepareOperations prepare;
protected ExecuteOperations execute;
Dispatcher dispatcher = init.initDispatcher(config);
init()
Container container = init_PreloadConfiguration();
private Container init_PreloadConfiguration() {
Configuration config = configurationManager.getConfiguration();
Container container = config.getContainer(); boolean reloadi18n = Boolean.valueOf(container.getInstance(String.class, StrutsConstants.STRUTS_I18N_RELOAD));
LocalizedTextUtil.setReloadBundles(reloadi18n); return container;
}
Configuration config = configurationManager.getConfiguration();
Container container = config.getContainer();
public synchronized Configuration getConfiguration() {
if (configuration == null) {
setConfiguration(createConfiguration(defaultFrameworkBeanName));
try {
configuration.reloadContainer(getContainerProviders());
} catch (ConfigurationException e) {
setConfiguration(null);
throw new ConfigurationException("Unable to load configuration.", e);
}
} else {
conditionalReload(configuration.getContainer());
} return configuration;
}....
prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
execute = new ExecuteOperations(filterConfig.getServletContext(), dispatcher);
标签:container,中是,strust2,getContainer,init,Container,configuration,config From: https://blog.51cto.com/u_16200746/6803366