org.springframework.web.servlet.resource

Class AbstractResourceResolver

  • java.lang.Object
    • org.springframework.web.servlet.resource.AbstractResourceResolver
    • Field Detail

      • logger

        protected final Log logger
    • Constructor Detail

      • AbstractResourceResolver

        public AbstractResourceResolver()
    • Method Detail

      • resolveResource

        @Nullable
        public Resource resolveResource(@Nullable
                                                  HttpServletRequest request,
                                                  java.lang.String requestPath,
                                                  java.util.List<? extends Resource> locations,
                                                  ResourceResolverChain chain)
        Description copied from interface: ResourceResolver
        Resolve the supplied request and request path to a Resource that exists under one of the given resource locations.
        Specified by:
        resolveResource in interface ResourceResolver
        Parameters:
        request - the current request (may not be present in some calls)
        requestPath - the portion of the request path to use
        locations - the locations to search in when looking up resources
        chain - the chain of remaining resolvers to delegate to
        Returns:
        the resolved resource, or null if unresolved
      • resolveUrlPath

        @Nullable
        public java.lang.String resolveUrlPath(java.lang.String resourceUrlPath,
                                                         java.util.List<? extends Resource> locations,
                                                         ResourceResolverChain chain)
        Description copied from interface: ResourceResolver
        Resolve the externally facing public URL path for clients to use to access the resource that is located at the given internal resource path.

        This is useful when rendering URL links to clients.

        Specified by:
        resolveUrlPath in interface ResourceResolver
        Parameters:
        resourceUrlPath - the internal resource path
        locations - the locations to search in when looking up resources
        chain - the chain of resolvers to delegate to
        Returns:
        the resolved public URL path, or null if unresolved
      • resolveUrlPathInternal

        @Nullable
        protected abstract java.lang.String resolveUrlPathInternal(java.lang.String resourceUrlPath,
                                                                             java.util.List<? extends Resource> locations,
                                                                             ResourceResolverChain chain)