首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

strust2中是怎么初始化container并且使其全局单例

2012-11-18 
strust2中是如何初始化container并且使其全局单例strust2中是如何初始化container并且使其全局单例??Strut

strust2中是如何初始化container并且使其全局单例

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);

?

?

?

?

热点排行