类 ServletPathExtensionContentNegotiationStrategy
- java.lang.Object
- org.springframework.web.accept.MappingMediaTypeFileExtensionResolver
- org.springframework.web.accept.AbstractMappingContentNegotiationStrategy
- org.springframework.web.accept.PathExtensionContentNegotiationStrategy
- org.springframework.web.accept.ServletPathExtensionContentNegotiationStrategy
@Deprecated public class ServletPathExtensionContentNegotiationStrategy extends PathExtensionContentNegotiationStrategy
已过时。as of 5.2.4. See class-level note inContentNegotiationManagerFactoryBeanon the deprecation of path extension config options.ExtendsPathExtensionContentNegotiationStrategythat also usesServletContext.getMimeType(String)to resolve file extensions.- 从以下版本开始:
- 3.2
- 作者:
- Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.web.accept.AbstractMappingContentNegotiationStrategy
logger
从接口继承的字段 org.springframework.web.accept.ContentNegotiationStrategy
MEDIA_TYPE_ALL_LIST
构造器概要
构造器 构造器 说明 ServletPathExtensionContentNegotiationStrategy(ServletContext context)已过时。Create an instance without any mappings to start with.ServletPathExtensionContentNegotiationStrategy(ServletContext servletContext, Map<String,MediaType> mediaTypes)已过时。Create an instance with the given extension-to-MediaType lookup.
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 MediaTypegetMediaTypeForResource(Resource resource)已过时。Extends the base classPathExtensionContentNegotiationStrategy.getMediaTypeForResource(org.springframework.core.io.Resource)with the ability to also look up through the ServletContext.protected MediaTypehandleNoMatch(NativeWebRequest webRequest, String extension)已过时。Resolve file extension viaServletContext.getMimeType(String)and also delegate to base class for a potentialMediaTypeFactorylookup.从类继承的方法 org.springframework.web.accept.PathExtensionContentNegotiationStrategy
getMediaTypeKey, setUrlPathHelper, setUseJaf
从类继承的方法 org.springframework.web.accept.AbstractMappingContentNegotiationStrategy
handleMatch, isIgnoreUnknownExtensions, isUseRegisteredExtensionsOnly, resolveMediaTypeKey, resolveMediaTypes, setIgnoreUnknownExtensions, setUseRegisteredExtensionsOnly
从类继承的方法 org.springframework.web.accept.MappingMediaTypeFileExtensionResolver
addMapping, getAllFileExtensions, getAllMediaTypes, getMediaTypes, lookupMediaType, resolveFileExtensions
构造器详细资料
ServletPathExtensionContentNegotiationStrategy
public ServletPathExtensionContentNegotiationStrategy(ServletContext context)
已过时。Create an instance without any mappings to start with. Mappings may be added later when extensions are resolved throughServletContext.getMimeType(String)or viaMediaTypeFactory.
ServletPathExtensionContentNegotiationStrategy
public ServletPathExtensionContentNegotiationStrategy(ServletContext servletContext, @Nullable Map<String,MediaType> mediaTypes)
已过时。Create an instance with the given extension-to-MediaType lookup.
方法详细资料
handleNoMatch
@Nullable protected MediaType handleNoMatch(NativeWebRequest webRequest, String extension) throws HttpMediaTypeNotAcceptableException
已过时。Resolve file extension viaServletContext.getMimeType(String)and also delegate to base class for a potentialMediaTypeFactorylookup.
getMediaTypeForResource
public MediaType getMediaTypeForResource(Resource resource)
已过时。Extends the base classPathExtensionContentNegotiationStrategy.getMediaTypeForResource(org.springframework.core.io.Resource)with the ability to also look up through the ServletContext.- 覆盖:
getMediaTypeForResource在类中PathExtensionContentNegotiationStrategy- 参数:
resource- the resource to look up- 返回:
- the MediaType for the extension, or
nullif none found - 从以下版本开始:
- 4.3