public class ResourceEntityResolver extends DelegatingEntityResolver
EntityResolver implementation that tries to resolve entity references
through a ResourceLoader (usually,
relative to the resource base of an ApplicationContext), if applicable.
Extends DelegatingEntityResolver to also provide DTD and XSD lookup.
Allows to use standard XML entities to include XML snippets into an application context definition, for example to split a large XML file into various modules. The include paths can be relative to the application context's resource base as usual, instead of relative to the JVM working directory (the XML parser's default).
Note: In addition to relative paths, every URL that specifies a file in the current system root, i.e. the JVM working directory, will be interpreted relative to the application context too.
ResourceLoader,
org.springframework.context.ApplicationContextDTD_SUFFIX, XSD_SUFFIX| 构造器和说明 |
|---|
ResourceEntityResolver(org.springframework.core.io.ResourceLoader resourceLoader)
Create a ResourceEntityResolver for the specified ResourceLoader
(usually, an ApplicationContext).
|
public ResourceEntityResolver(org.springframework.core.io.ResourceLoader resourceLoader)
resourceLoader - the ResourceLoader (or ApplicationContext)
to load XML entity includes with@Nullable public InputSource resolveEntity(@Nullable String publicId, @Nullable String systemId) throws SAXException, IOException
resolveEntity 在接口中 EntityResolverresolveEntity 在类中 DelegatingEntityResolverSAXExceptionIOException