ContentNegotiationManagerFactoryBean
on the deprecation of path
extension config options.@Deprecated public class ServletPathExtensionContentNegotiationStrategy extends PathExtensionContentNegotiationStrategy
PathExtensionContentNegotiationStrategy
that also uses
ServletContext.getMimeType(String)
to resolve file extensions.logger
MEDIA_TYPE_ALL_LIST
Constructor and Description |
---|
ServletPathExtensionContentNegotiationStrategy(ServletContext context)
Deprecated.
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.
|
Modifier and Type | Method and Description |
---|---|
MediaType |
getMediaTypeForResource(Resource resource)
Deprecated.
Extends the base class
PathExtensionContentNegotiationStrategy.getMediaTypeForResource(org.springframework.core.io.Resource)
with the ability to also look up through the ServletContext. |
protected MediaType |
handleNoMatch(NativeWebRequest webRequest,
String extension)
Deprecated.
Resolve file extension via
ServletContext.getMimeType(String)
and also delegate to base class for a potential
MediaTypeFactory lookup. |
getMediaTypeKey, setUrlPathHelper, setUseJaf
handleMatch, isIgnoreUnknownExtensions, isUseRegisteredExtensionsOnly, resolveMediaTypeKey, resolveMediaTypes, setIgnoreUnknownExtensions, setUseRegisteredExtensionsOnly
addMapping, getAllFileExtensions, getAllMediaTypes, getMediaTypes, lookupMediaType, resolveFileExtensions
public ServletPathExtensionContentNegotiationStrategy(ServletContext context)
ServletContext.getMimeType(String)
or via
MediaTypeFactory
.public ServletPathExtensionContentNegotiationStrategy(ServletContext servletContext, @Nullable Map<String,MediaType> mediaTypes)
@Nullable protected MediaType handleNoMatch(NativeWebRequest webRequest, String extension) throws HttpMediaTypeNotAcceptableException
ServletContext.getMimeType(String)
and also delegate to base class for a potential
MediaTypeFactory
lookup.handleNoMatch
in class AbstractMappingContentNegotiationStrategy
HttpMediaTypeNotAcceptableException
public MediaType getMediaTypeForResource(Resource resource)
PathExtensionContentNegotiationStrategy.getMediaTypeForResource(org.springframework.core.io.Resource)
with the ability to also look up through the ServletContext.getMediaTypeForResource
in class PathExtensionContentNegotiationStrategy
resource
- the resource to look upnull
if none found