类 PathExtensionContentNegotiationStrategy

所有已实现的接口:
ContentNegotiationStrategy, MediaTypeFileExtensionResolver

public class PathExtensionContentNegotiationStrategy extends AbstractMappingContentNegotiationStrategy
A ContentNegotiationStrategy that resolves the file extension in the request path to a key to be used to look up a media type.

If the file extension is not found in the explicit registrations provided to the constructor, the MediaType.fromFileName(String) is used as a fallback mechanism.

从以下版本开始:
4.0 2022/2/7 13:59
作者:
Rossen Stoyanchev, Harry Yang
  • 字段详细资料

    • servletContext

      @Nullable private final Object servletContext
  • 构造器详细资料

    • PathExtensionContentNegotiationStrategy

      public PathExtensionContentNegotiationStrategy()
      Create an instance without any mappings to start with. Mappings may be added later on if any extensions are resolved through the Java Activation framework.
    • PathExtensionContentNegotiationStrategy

      public PathExtensionContentNegotiationStrategy(@Nullable Map<String,MediaType> mediaTypes)
      Create an instance with the given map of file extensions and media types.
    • PathExtensionContentNegotiationStrategy

      public PathExtensionContentNegotiationStrategy(@Nullable Object servletContext, @Nullable Map<String,MediaType> mediaTypes)
      Create an instance with the given map of file extensions and media types.
  • 方法详细资料