Class ContentNegotiationConfigurer

java.lang.Object
org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer

public class ContentNegotiationConfigurer extends Object
Creates a ContentNegotiationManager and configures it with one or more ContentNegotiationStrategy instances.

This factory offers properties that in turn result in configuring the underlying strategies. The table below shows the property names, their default settings, as well as the strategies that they help to configure:

Property Setter Default Value Underlying Strategy Enabled Or Not
favorParameter(boolean) false ParameterContentNegotiationStrategy Off
ignoreAcceptHeader(boolean) false HeaderContentNegotiationStrategy Enabled
defaultContentType(org.springframework.http.MediaType...) null FixedContentNegotiationStrategy Off
defaultContentTypeStrategy(org.springframework.web.accept.ContentNegotiationStrategy) null ContentNegotiationStrategy Off

As of 5.0 you can set the exact strategies to use via strategies(List).

Since:
3.2
Author:
Rossen Stoyanchev