Package org.springframework.web.server
Class MethodNotAllowedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.web.ErrorResponseException
org.springframework.web.server.ResponseStatusException
org.springframework.web.server.MethodNotAllowedException
- All Implemented Interfaces:
- Serializable,- ErrorResponse
Exception for errors that fit response status 405 (method not allowed).
- Since:
- 5.0
- Author:
- Rossen Stoyanchev
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionMethodNotAllowedException(String method, Collection<HttpMethod> supportedMethods) MethodNotAllowedException(HttpMethod method, Collection<HttpMethod> supportedMethods) 
- 
Method SummaryModifier and TypeMethodDescriptionReturn HttpHeaders with an "Allow" header that documents the allowed HTTP methods for this URL, if available, or an empty instance otherwise.Return the HTTP method for the failed request.Deprecated.Return the list of supported HTTP methods.Methods inherited from class org.springframework.web.server.ResponseStatusExceptiongetMessage, getReasonMethods inherited from class org.springframework.web.ErrorResponseExceptiongetBody, getStatusCode, setDetail, setInstance, setTitle, setTypeMethods inherited from class org.springframework.core.NestedRuntimeExceptioncontains, getMostSpecificCause, getRootCauseMethods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
MethodNotAllowedException
- 
MethodNotAllowedException
 
- 
- 
Method Details- 
getHeadersReturn HttpHeaders with an "Allow" header that documents the allowed HTTP methods for this URL, if available, or an empty instance otherwise.- Specified by:
- getHeadersin interface- ErrorResponse
- Overrides:
- getHeadersin class- ResponseStatusException
 
- 
getResponseHeadersDeprecated.as of 6.0 in favor ofgetHeaders()Delegates togetHeaders().- Overrides:
- getResponseHeadersin class- ResponseStatusException
- Since:
- 5.1.13
 
- 
getHttpMethodReturn the HTTP method for the failed request.
- 
getSupportedMethodsReturn the list of supported HTTP methods.
 
- 
getHeaders()