类 NotAcceptableStatusException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- org.springframework.core.NestedRuntimeException
- org.springframework.web.server.ResponseStatusException
- org.springframework.web.server.NotAcceptableStatusException
- 所有已实现的接口:
Serializable
public class NotAcceptableStatusException extends ResponseStatusException
Exception for errors that fit response status 406 (not acceptable).- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 NotAcceptableStatusException(String reason)
Constructor for when the requested Content-Type is invalid.NotAcceptableStatusException(List<MediaType> supportedMediaTypes)
Constructor for when the requested Content-Type is not supported.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Map<String,String>
getHeaders()
Return a Map with an "Accept" header.HttpHeaders
getResponseHeaders()
Return HttpHeaders with an "Accept" header, or an empty instance.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.从类继承的方法 org.springframework.web.server.ResponseStatusException
getMessage, getReason, getStatus
从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
构造器详细资料
NotAcceptableStatusException
public NotAcceptableStatusException(String reason)
Constructor for when the requested Content-Type is invalid.
NotAcceptableStatusException
public NotAcceptableStatusException(List<MediaType> supportedMediaTypes)
Constructor for when the requested Content-Type is not supported.
方法详细资料
getHeaders
public Map<String,String> getHeaders()
Return a Map with an "Accept" header.- 覆盖:
getHeaders
在类中ResponseStatusException
- 从以下版本开始:
- 5.1.11
getResponseHeaders
public HttpHeaders getResponseHeaders()
Return HttpHeaders with an "Accept" header, or an empty instance.- 覆盖:
getResponseHeaders
在类中ResponseStatusException
- 从以下版本开始:
- 5.1.13
getSupportedMediaTypes
public 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.