org.springframework.web.servlet.resource

Interface ResourceResolver

    • Method Detail

      • resolveResource

        @Nullable
        Resource resolveResource(@Nullable
                                           HttpServletRequest request,
                                           java.lang.String requestPath,
                                           java.util.List<? extends Resource> locations,
                                           ResourceResolverChain chain)
        Resolve the supplied request and request path to a Resource that exists under one of the given resource locations.
        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
        java.lang.String resolveUrlPath(java.lang.String resourcePath,
                                                  java.util.List<? extends Resource> locations,
                                                  ResourceResolverChain chain)
        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.

        Parameters:
        resourcePath - 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