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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ErrorResponse
ErrorResponse.Builder, ErrorResponse.Interceptor
-
Constructor Summary
ConstructorsConstructorDescriptionMethodNotAllowedException
(String method, @Nullable Collection<HttpMethod> supportedMethods) MethodNotAllowedException
(HttpMethod method, Collection<HttpMethod> supportedMethods) -
Method Summary
Modifier 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.Return the list of supported HTTP methods.Methods inherited from class ResponseStatusException
getMessage, getReason, updateAndGetBody
Methods inherited from class ErrorResponseException
getBody, getDetailMessageArguments, getDetailMessageCode, getStatusCode, setDetail, setInstance, setTitle, setType
Methods inherited from class NestedRuntimeException
contains, getMostSpecificCause, getRootCause
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ErrorResponse
getDetailMessageArguments, getTitleMessageCode, getTypeMessageCode
-
Constructor Details
-
MethodNotAllowedException
-
MethodNotAllowedException
-
-
Method Details
-
getHeaders
Return HttpHeaders with an "Allow" header that documents the allowed HTTP methods for this URL, if available, or an empty instance otherwise.- Specified by:
getHeaders
in interfaceErrorResponse
- Overrides:
getHeaders
in classResponseStatusException
-
getHttpMethod
Return the HTTP method for the failed request. -
getSupportedMethods
Return the list of supported HTTP methods.
-