Example usage for org.springframework.web.accept FixedContentNegotiationStrategy FixedContentNegotiationStrategy

List of usage examples for org.springframework.web.accept FixedContentNegotiationStrategy FixedContentNegotiationStrategy

Introduction

In this page you can find the example usage for org.springframework.web.accept FixedContentNegotiationStrategy FixedContentNegotiationStrategy.

Prototype

public FixedContentNegotiationStrategy(List<MediaType> contentTypes) 

Source Link

Document

Constructor with an ordered List of default MediaType 's to return for use in applications that support a variety of content types.

Usage

From source file:cz.jirutka.spring.exhandler.RestHandlerExceptionResolver.java

@Override
public void afterPropertiesSet() {
    if (contentNegotiationManager == null) {
        contentNegotiationManager = new ContentNegotiationManager(new HeaderContentNegotiationStrategy(),
                new FixedContentNegotiationStrategy(defaultContentType));
    }//from w  w w .  j a v a  2s.  co  m
    responseProcessor = new HttpEntityMethodProcessor(messageConverters, contentNegotiationManager);
    fallbackResponseProcessor = new HttpEntityMethodProcessor(messageConverters,
            new ContentNegotiationManager(new FixedContentNegotiationStrategy(defaultContentType)));
}