webx初始化:
listener:
WebxContextLoaderListener extends ContextLoaderListener
覆写了:ContextLoader createContextLoader(){
new WebxComponentsLoader();
}
WebxComponentsLoader覆写了ContextLoader的initWebApplicationContext()方法。
覆写了
customizeContext()
determineContextClass() 返回WebxComponentsContext
WebxComponentsContext extends WebxApplicationContext
覆写了:
protected String[] getDefaultConfigLocations(){
if (getNamespace() != null) {
return new String[] { WEBX_COMPONENT_CONFIGURATION_LOCATION_PATTERN.replace("*", getNamespace()) };
} else {
return new String[] { WEBX_CONFIGURATION_LOCATION };
}
}
取得默认的Spring配置文件名,Root context默认配置文件为/WEB-INF/webx.xml;
ActionEventAdapter
PipelineImpl
WebxRootControllerImpl
AbstractWebxRootController
TurbineRunDataImpl
ClassPathResource resource = new ClassPathResource("test.xml");
XmlApplicationContext context = new XmlApplicationContext(resource);
ResourceLoadingService service = (ResourceLoadingService) context
.getBean("resourceLoadingService");
Resource r = service.getResource("/templates/place/screen/test.vm");
System.out.println(r.getURL());
ResourceLoader初始化
new ResourceMapping().init();
ResourcePattern.init()
------->
ResourceLoaderMapping.init()
-------------->FileResourceLoader.init()