Top Description Constructors Methods
org.springframework.web.accept

public Class HeaderContentNegotiationStrategy

extends Object
implements ContentNegotiationStrategy
Class Inheritance
All Implemented Interfaces
org.springframework.web.accept.ContentNegotiationStrategy
Imports
java.util.Arrays, .List, org.springframework.http.HttpHeaders, .InvalidMediaTypeException, .MediaType, org.springframework.util.CollectionUtils, .MimeTypeUtils, org.springframework.web.HttpMediaTypeNotAcceptableException, org.springframework.web.context.request.NativeWebRequest

A ContentNegotiationStrategy that checks the 'Accept' request header.
Authors
Rossen Stoyanchev, Juergen Hoeller
Since
3.2

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<MediaType>
resolveMediaTypes(NativeWebRequest
the current request
request
)

Implements org.springframework.web.accept.ContentNegotiationStrategy.resolveMediaTypes.

Resolve the given request to a list of media types.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

HeaderContentNegotiationStrategyback to summary
public HeaderContentNegotiationStrategy()

Method Detail

resolveMediaTypesback to summary
public List<MediaType> resolveMediaTypes(NativeWebRequest request) throws HttpMediaTypeNotAcceptableException

Implements org.springframework.web.accept.ContentNegotiationStrategy.resolveMediaTypes.

Doc from org.springframework.web.accept.ContentNegotiationStrategy.resolveMediaTypes.

Resolve the given request to a list of media types. The returned list is ordered by specificity first and by quality parameter second.

Parameters
request:NativeWebRequest

the current request

Returns:List<MediaType>

the requested media types, or MEDIA_TYPE_ALL_LIST if none were requested.

Annotations
@Override
Exceptions
HttpMediaTypeNotAcceptableException:
if the 'Accept' header cannot be parsed