org.springframework.web.server

Class NotAcceptableStatusException

  • All Implemented Interfaces:
    java.io.Serializable


    public class NotAcceptableStatusException
    extends ResponseStatusException
    Exception for errors that fit response status 406 (not acceptable).
    Since:
    5.0
    Author:
    Rossen Stoyanchev
    See Also:
    Serialized Form
    • Constructor Detail

      • NotAcceptableStatusException

        public NotAcceptableStatusException(java.lang.String reason)
        Constructor for when the requested Content-Type is invalid.
      • NotAcceptableStatusException

        public NotAcceptableStatusException(java.util.List<MediaType> supportedMediaTypes)
        Constructor for when requested Content-Type is not supported.
    • Method Detail

      • getSupportedMediaTypes

        public java.util.List<MediaType> getSupportedMediaTypes()
        Return the list of supported content types in cases when the Accept header is parsed but not supported, or an empty list otherwise.