/*
* Stores the mappings from namespace URI to NamespaceHandler class name / instance.
**/@NullableprivatevolatileMap<String,Object> handlerMappings;//加载位置publicstaticfinalStringDEFAULT_HANDLER_MAPPINGS_LOCATION="META-INF/spring.handlers";// 加载关键信息Properties mappings =PropertiesLoaderUtils.loadAllProperties(this.handlerMappingsLocation,this.classLoader);
在类创建时并没有加载handlerMappings
publicDefaultNamespaceHandlerResolver(@NullableClassLoader classLoader,String handlerMappingsLocation){Assert.notNull(handlerMappingsLocation,"Handler mappings location must not be null");this.classLoader =(classLoader !=null? classLoader :ClassUtils.getDefaultClassLoader());this.handlerMappingsLocation = handlerMappingsLocation;}
为什么在用的时候就有了呢,而且断点也不进入,原来在这里
@OverridepublicStringtoString(){return"NamespaceHandlerResolver using mappings "+getHandlerMappings();}