org.springframework.web.accept

Class FixedContentNegotiationStrategy

  • java.lang.Object
    • org.springframework.web.accept.FixedContentNegotiationStrategy
  • All Implemented Interfaces:
    ContentNegotiationStrategy


    public class FixedContentNegotiationStrategy
    extends java.lang.Object
    implements ContentNegotiationStrategy
    A ContentNegotiationStrategy that returns a fixed content type.
    Since:
    3.2
    Author:
    Rossen Stoyanchev
    • Constructor Detail

      • FixedContentNegotiationStrategy

        public FixedContentNegotiationStrategy(MediaType contentType)
        Constructor with a single default MediaType.
      • FixedContentNegotiationStrategy

        public FixedContentNegotiationStrategy(java.util.List<MediaType> contentTypes)
        Constructor with an ordered List of default MediaType's to return for use in applications that support a variety of content types.

        Consider appending MediaType.ALL at the end if destinations are present which do not support any of the other default media types.

        Since:
        5.0