Deprecated
as of 5.2.4. See class-level note in
ContentNegotiationManagerFactoryBean on the deprecation of path
extension config options.
PathExtensionContentNegotiationStrategy that also uses
ServletContext#getMimeType(String) to resolve file extensions.
| Modifier and Type | Field and Description |
|---|---|
| private final ServletContext |
| Access | Constructor and Description |
|---|---|
| public | ServletPathExtensionContentNegotiationStrategy(ServletContext context)
Create an instance without any mappings to start with. |
| public | ServletPathExtensionContentNegotiationStrategy(ServletContext servletContext, Map<String, MediaType> mediaTypes)
Create an instance with the given extension-to-MediaType lookup. |
| Modifier and Type | Method and Description |
|---|---|
| public MediaType | Returns: the MediaType for the extension, ornull if none foundthe resource to look up resource)Overrides org. PathExtensionContentNegotiationStrategy#getMediaTypeForResource
with the ability to also look up through the ServletContext.
|
| protected MediaType | handleNoMatch(NativeWebRequest webRequest, String extension)
Overrides org. ServletContext#getMimeType(String)
and also delegate to base class for a potential
org. lookup.
|
| servletContext | back to summary |
|---|---|
| private final ServletContext servletContext | |
| ServletPathExtensionContentNegotiationStrategy | back to summary |
|---|---|
| public ServletPathExtensionContentNegotiationStrategy(ServletContext context) Create an instance without any mappings to start with. Mappings may be
added later when extensions are resolved through
| |
| ServletPathExtensionContentNegotiationStrategy | back to summary |
|---|---|
| public ServletPathExtensionContentNegotiationStrategy(ServletContext servletContext, Map<String, MediaType> mediaTypes) Create an instance with the given extension-to-MediaType lookup. | |
| getMediaTypeForResource | back to summary |
|---|---|
| public MediaType getMediaTypeForResource(Resource resource) Overrides org. Extends the base class
| |
| handleNoMatch | back to summary |
|---|---|
| protected MediaType handleNoMatch(NativeWebRequest webRequest, String extension) throws HttpMediaTypeNotAcceptableException Overrides org. Resolve file extension via | |