Package org.springframework.web.accept
Class HeaderContentNegotiationStrategy
java.lang.Object
org.springframework.web.accept.HeaderContentNegotiationStrategy
- All Implemented Interfaces:
- ContentNegotiationStrategy
A 
ContentNegotiationStrategy that checks the 'Accept' request header.- Since:
- 3.2
- Author:
- Rossen Stoyanchev, Juergen Hoeller
- 
Field SummaryFields inherited from interface org.springframework.web.accept.ContentNegotiationStrategyMEDIA_TYPE_ALL_LIST
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionresolveMediaTypes(NativeWebRequest request) Resolve the given request to a list of media types.
- 
Constructor Details- 
HeaderContentNegotiationStrategypublic HeaderContentNegotiationStrategy()
 
- 
- 
Method Details- 
resolveMediaTypespublic List<MediaType> resolveMediaTypes(NativeWebRequest request) throws HttpMediaTypeNotAcceptableException Resolve the given request to a list of media types. The returned list is ordered by specificity first and by quality parameter second.- Specified by:
- resolveMediaTypesin interface- ContentNegotiationStrategy
- Parameters:
- request- the current request
- Returns:
- the requested media types, or ContentNegotiationStrategy.MEDIA_TYPE_ALL_LISTif none were requested.
- Throws:
- HttpMediaTypeNotAcceptableException- if the 'Accept' header cannot be parsed
 
 
-