类的使用
cn.taketoday.web.config.ContentNegotiationConfigurer
-
cn.taketoday.web.config中ContentNegotiationConfigurer的使用
修饰符和类型方法说明private ContentNegotiationConfigurerWebMvcConfigurationSupport.createNegotiationConfigurer()ContentNegotiationConfigurer.defaultContentType(MediaType... defaultContentTypes) Set the default content type(s) to use when no content type is requested in order of priority.ContentNegotiationConfigurer.defaultContentTypeStrategy(ContentNegotiationStrategy defaultStrategy) Set a customContentNegotiationStrategyto use to determine the content type to use when no content type is requested.ContentNegotiationConfigurer.favorParameter(boolean favorParameter) Whether a request parameter ("format" by default) should be used to determine the requested media type.ContentNegotiationConfigurer.ignoreAcceptHeader(boolean ignoreAcceptHeader) Whether to disable checking the 'Accept' request header.Add a mapping from a key, extracted from a path extension or a query parameter, to a MediaType.ContentNegotiationConfigurer.mediaTypes(Map<String, MediaType> mediaTypes) An alternative tomediaType(java.lang.String, cn.taketoday.http.MediaType).ContentNegotiationConfigurer.parameterName(String parameterName) Set the query parameter name to use whenfavorParameter(boolean)is on.ContentNegotiationConfigurer.replaceMediaTypes(Map<String, MediaType> mediaTypes) Similar tomediaType(java.lang.String, cn.taketoday.http.MediaType)but for replacing existing mappings.ContentNegotiationConfigurer.useRegisteredExtensionsOnly(boolean useRegisteredExtensionsOnly) this property determines whether to use only registeredMediaTypemappings to resolve a path extension to a specific MediaType.修饰符和类型方法说明voidCompositeWebMvcConfigurer.configureContentNegotiation(ContentNegotiationConfigurer configurer) protected voidDelegatingWebMvcConfiguration.configureContentNegotiation(ContentNegotiationConfigurer configurer) protected voidWebMvcConfigurationSupport.configureContentNegotiation(ContentNegotiationConfigurer configurer) Override this method to configure content negotiation.default voidWebMvcConfigurer.configureContentNegotiation(ContentNegotiationConfigurer configurer) Configure content negotiation options.