类 MethodNotAllowedException
- 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.MethodNotAllowedException
- 所有已实现的接口:
Serializable
public class MethodNotAllowedException extends ResponseStatusException
Exception for errors that fit response status 405 (method not allowed).- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 MethodNotAllowedException(String method, Collection<HttpMethod> supportedMethods)
MethodNotAllowedException(HttpMethod method, Collection<HttpMethod> supportedMethods)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Map<String,String>
getHeaders()
Return a Map with an "Allow" header.String
getHttpMethod()
Return the HTTP method for the failed request.HttpHeaders
getResponseHeaders()
Return HttpHeaders with an "Allow" header.Set<HttpMethod>
getSupportedMethods()
Return the list of supported HTTP methods.从类继承的方法 org.springframework.web.server.ResponseStatusException
getMessage, getReason, getStatus
从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMostSpecificCause, getRootCause
构造器详细资料
MethodNotAllowedException
public MethodNotAllowedException(HttpMethod method, Collection<HttpMethod> supportedMethods)
MethodNotAllowedException
public MethodNotAllowedException(String method, @Nullable Collection<HttpMethod> supportedMethods)
方法详细资料
getHeaders
public Map<String,String> getHeaders()
Return a Map with an "Allow" header.- 覆盖:
getHeaders
在类中ResponseStatusException
- 从以下版本开始:
- 5.1.11
getResponseHeaders
public HttpHeaders getResponseHeaders()
Return HttpHeaders with an "Allow" header.- 覆盖:
getResponseHeaders
在类中ResponseStatusException
- 从以下版本开始:
- 5.1.13
getHttpMethod
public String getHttpMethod()
Return the HTTP method for the failed request.
getSupportedMethods
public Set<HttpMethod> getSupportedMethods()
Return the list of supported HTTP methods.