Package org.springframework.web.accept
Class ServletPathExtensionContentNegotiationStrategy
java.lang.Object
org.springframework.web.accept.MappingMediaTypeFileExtensionResolver
org.springframework.web.accept.AbstractMappingContentNegotiationStrategy
org.springframework.web.accept.PathExtensionContentNegotiationStrategy
org.springframework.web.accept.ServletPathExtensionContentNegotiationStrategy
- All Implemented Interfaces:
- ContentNegotiationStrategy,- MediaTypeFileExtensionResolver
@Deprecated
public class ServletPathExtensionContentNegotiationStrategy
extends PathExtensionContentNegotiationStrategy
Deprecated.
Extends 
PathExtensionContentNegotiationStrategy that also uses
 ServletContext.getMimeType(String) to resolve file extensions.- Since:
- 3.2
- Author:
- Rossen Stoyanchev
- 
Field SummaryFields inherited from class org.springframework.web.accept.AbstractMappingContentNegotiationStrategyloggerFields inherited from interface org.springframework.web.accept.ContentNegotiationStrategyMEDIA_TYPE_ALL_LIST
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated.Create an instance without any mappings to start with.ServletPathExtensionContentNegotiationStrategy(ServletContext servletContext, Map<String, MediaType> mediaTypes) Deprecated.Create an instance with the given extension-to-MediaType lookup.
- 
Method SummaryModifier and TypeMethodDescriptiongetMediaTypeForResource(Resource resource) Deprecated.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) Deprecated.Resolve file extension viaServletContext.getMimeType(String)and also delegate to base class for a potentialMediaTypeFactorylookup.Methods inherited from class org.springframework.web.accept.PathExtensionContentNegotiationStrategygetMediaTypeKey, setUrlPathHelper, setUseJafMethods inherited from class org.springframework.web.accept.AbstractMappingContentNegotiationStrategyhandleMatch, isIgnoreUnknownExtensions, isUseRegisteredExtensionsOnly, resolveMediaTypeKey, resolveMediaTypes, setIgnoreUnknownExtensions, setUseRegisteredExtensionsOnlyMethods inherited from class org.springframework.web.accept.MappingMediaTypeFileExtensionResolveraddMapping, getAllFileExtensions, getAllMediaTypes, getMediaTypes, lookupMediaType, resolveFileExtensions
- 
Constructor Details- 
ServletPathExtensionContentNegotiationStrategyDeprecated.Create an instance without any mappings to start with. Mappings may be added later when extensions are resolved throughServletContext.getMimeType(String)or viaMediaTypeFactory.
- 
ServletPathExtensionContentNegotiationStrategypublic ServletPathExtensionContentNegotiationStrategy(ServletContext servletContext, @Nullable Map<String, MediaType> mediaTypes) Deprecated.Create an instance with the given extension-to-MediaType lookup.
 
- 
- 
Method Details- 
handleNoMatch@Nullable protected MediaType handleNoMatch(NativeWebRequest webRequest, String extension) throws HttpMediaTypeNotAcceptableException Deprecated.Resolve file extension viaServletContext.getMimeType(String)and also delegate to base class for a potentialMediaTypeFactorylookup.- Overrides:
- handleNoMatchin class- AbstractMappingContentNegotiationStrategy
- Throws:
- HttpMediaTypeNotAcceptableException
 
- 
getMediaTypeForResourceDeprecated.Extends the base classPathExtensionContentNegotiationStrategy.getMediaTypeForResource(org.springframework.core.io.Resource)with the ability to also look up through the ServletContext.- Overrides:
- getMediaTypeForResourcein class- PathExtensionContentNegotiationStrategy
- Parameters:
- resource- the resource to look up
- Returns:
- the MediaType for the extension, or nullif none found
- Since:
- 4.3
 
 
- 
ContentNegotiationManagerFactoryBeanon the deprecation of path extension config options.