クラスの使用
org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer
org.springframework.web.servlet.config.annotation 内の ContentNegotiationConfigurer 使用
修飾子と型メソッド説明ContentNegotiationConfigurer.defaultContentType
(MediaType... defaultContentTypes) コンテンツ型が優先度順にリクエストされない場合に使用するデフォルトのコンテンツ型を設定します。ContentNegotiationConfigurer.defaultContentTypeStrategy
(ContentNegotiationStrategy defaultStrategy) コンテンツ型がリクエストされていないときに使用するコンテンツ型を決定するために使用するカスタムContentNegotiationStrategy
を設定します。ContentNegotiationConfigurer.favorParameter
(boolean favorParameter) リクエストされたメディア型を判別するためにリクエストパラメーター(デフォルトでは "format" )を使用する必要があるかどうか。ContentNegotiationConfigurer.favorPathExtension
(boolean favorPathExtension) 使用すべきではありません。5.2.4 現在。ContentNegotiationConfigurer.ignoreAcceptHeader
(boolean ignoreAcceptHeader) "Accept" リクエストヘッダーのチェックを無効にするかどうか。ContentNegotiationConfigurer.ignoreUnknownPathExtensions
(boolean ignore) 使用すべきではありません。5.2.4 現在。パス拡張またはクエリパラメーターから抽出されたキーから MediaType へのマッピングを追加します。ContentNegotiationConfigurer.mediaTypes
(MapSE<StringSE, MediaType> mediaTypes) ContentNegotiationConfigurer.parameterName
(StringSE parameterName) favorParameter(boolean)
がオンのときに使用するクエリパラメーター名を設定します。ContentNegotiationConfigurer.replaceMediaTypes
(MapSE<StringSE, MediaType> mediaTypes) mediaType(java.lang.String, org.springframework.http.MediaType)
に似ていますが、既存のマッピングを置き換えるためのものです。ContentNegotiationConfigurer.useJaf
(boolean useJaf) 使用すべきではありません。5.0 以降、逆の動作をするuseRegisteredExtensionsOnly(boolean)
を推奨ContentNegotiationConfigurer.useRegisteredExtensionsOnly
(boolean useRegisteredExtensionsOnly) favorPathExtension
が設定されている場合、このプロパティは、登録されたMediaType
マッピングのみを使用して特定の MediaType へのパス拡張を解決するかどうかを決定します。修飾子と型メソッド説明protected void
DelegatingWebMvcConfiguration.configureContentNegotiation
(ContentNegotiationConfigurer configurer) protected void
WebMvcConfigurationSupport.configureContentNegotiation
(ContentNegotiationConfigurer configurer) コンテンツネゴシエーションを構成するには、このメソッドをオーバーライドします。default void
WebMvcConfigurer.configureContentNegotiation
(ContentNegotiationConfigurer configurer) コンテンツネゴシエーションオプションを構成します。