接口的使用
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中的类 修饰符和类型 类 说明 classAbstractMappingContentNegotiationStrategyBase class forContentNegotiationStrategyimplementations with the steps to resolve a request to media types.classContentNegotiationManagerCentral class to determine requested media types for a request.classFixedContentNegotiationStrategyAContentNegotiationStrategythat returns a fixed content type.classHeaderContentNegotiationStrategyAContentNegotiationStrategythat checks the 'Accept' request header.classParameterContentNegotiationStrategyStrategy that resolves the requested content type from a query parameter.classPathExtensionContentNegotiationStrategy已过时。as of 5.2.4.classServletPathExtensionContentNegotiationStrategy已过时。as of 5.2.4.类型参数类型为ContentNegotiationStrategy的org.springframework.web.accept中的方法 修饰符和类型 方法 说明 <T extends ContentNegotiationStrategy>
TContentNegotiationManager. getStrategy(Class<T> strategyType)Find aContentNegotiationStrategyof the given type.返回变量类型为ContentNegotiationStrategy的类型的org.springframework.web.accept中的方法 修饰符和类型 方法 说明 List<ContentNegotiationStrategy>ContentNegotiationManager. getStrategies()Return the configured content negotiation strategies.参数类型为ContentNegotiationStrategy的org.springframework.web.accept中的方法 修饰符和类型 方法 说明 voidContentNegotiationManagerFactoryBean. setDefaultContentTypeStrategy(ContentNegotiationStrategy strategy)Set a customContentNegotiationStrategyto use to determine the content type to use when no content type is requested.类型变量类型为ContentNegotiationStrategy的org.springframework.web.accept中的方法参数 修饰符和类型 方法 说明 voidContentNegotiationManagerFactoryBean. 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 ofContentNegotiationStrategystrategies 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中的方法 修饰符和类型 方法 说明 ContentNegotiationConfigurerContentNegotiationConfigurer. defaultContentTypeStrategy(ContentNegotiationStrategy defaultStrategy)Set a customContentNegotiationStrategyto use to determine the content type to use when no content type is requested.类型变量类型为ContentNegotiationStrategy的org.springframework.web.servlet.config.annotation中的方法参数 修饰符和类型 方法 说明 voidContentNegotiationConfigurer. strategies(List<ContentNegotiationStrategy> strategies)Set the exact list of strategies to use.