接口的使用
org.springframework.web.accept.ContentNegotiationStrategy
使用ContentNegotiationStrategy的程序包 程序包 说明 org.springframework.web.accept This package contains classes used to determine the requested the media types in a request.org.springframework.web.servlet.config.annotation Annotation-based setup for Spring MVC.org.springframework.web.accept中ContentNegotiationStrategy的使用
实现ContentNegotiationStrategy的org.springframework.web.accept中的类 修饰符和类型 类 说明 class
AbstractMappingContentNegotiationStrategy
Base class forContentNegotiationStrategy
implementations with the steps to resolve a request to media types.class
ContentNegotiationManager
Central class to determine requested media types for a request.class
FixedContentNegotiationStrategy
AContentNegotiationStrategy
that returns a fixed content type.class
HeaderContentNegotiationStrategy
AContentNegotiationStrategy
that checks the 'Accept' request header.class
ParameterContentNegotiationStrategy
Strategy that resolves the requested content type from a query parameter.class
PathExtensionContentNegotiationStrategy
已过时。as of 5.2.4.class
ServletPathExtensionContentNegotiationStrategy
已过时。as of 5.2.4.类型参数类型为ContentNegotiationStrategy的org.springframework.web.accept中的方法 修饰符和类型 方法 说明 <T extends ContentNegotiationStrategy>
TContentNegotiationManager. getStrategy(Class<T> strategyType)
Find aContentNegotiationStrategy
of the given type.返回变量类型为ContentNegotiationStrategy的类型的org.springframework.web.accept中的方法 修饰符和类型 方法 说明 List<ContentNegotiationStrategy>
ContentNegotiationManager. getStrategies()
Return the configured content negotiation strategies.参数类型为ContentNegotiationStrategy的org.springframework.web.accept中的方法 修饰符和类型 方法 说明 void
ContentNegotiationManagerFactoryBean. setDefaultContentTypeStrategy(ContentNegotiationStrategy strategy)
Set a customContentNegotiationStrategy
to use to determine the content type to use when no content type is requested.类型变量类型为ContentNegotiationStrategy的org.springframework.web.accept中的方法参数 修饰符和类型 方法 说明 void
ContentNegotiationManagerFactoryBean. setStrategies(List<ContentNegotiationStrategy> strategies)
Set the exact list of strategies to use.参数类型为ContentNegotiationStrategy的org.springframework.web.accept中的构造器 构造器 说明 ContentNegotiationManager(ContentNegotiationStrategy... strategies)
Create an instance with the given list ofContentNegotiationStrategy
strategies each of which may also be an instance ofMediaTypeFileExtensionResolver
.类型变量类型为ContentNegotiationStrategy的org.springframework.web.accept中的构造器参数 构造器 说明 ContentNegotiationManager(Collection<ContentNegotiationStrategy> strategies)
A collection-based alternative toContentNegotiationManager(ContentNegotiationStrategy...)
.org.springframework.web.servlet.config.annotation中ContentNegotiationStrategy的使用
参数类型为ContentNegotiationStrategy的org.springframework.web.servlet.config.annotation中的方法 修饰符和类型 方法 说明 ContentNegotiationConfigurer
ContentNegotiationConfigurer. defaultContentTypeStrategy(ContentNegotiationStrategy defaultStrategy)
Set a customContentNegotiationStrategy
to use to determine the content type to use when no content type is requested.类型变量类型为ContentNegotiationStrategy的org.springframework.web.servlet.config.annotation中的方法参数 修饰符和类型 方法 说明 void
ContentNegotiationConfigurer. strategies(List<ContentNegotiationStrategy> strategies)
Set the exact list of strategies to use.