Package org.springframework.web
Class HttpRequestMethodNotSupportedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.springframework.web.HttpRequestMethodNotSupportedException
- All Implemented Interfaces:
- Serializable
Exception thrown when a request handler does not support a
 specific request method.
- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new HttpRequestMethodNotSupportedException.HttpRequestMethodNotSupportedException(String method, String msg) Create a new HttpRequestMethodNotSupportedException.HttpRequestMethodNotSupportedException(String method, String[] supportedMethods) Create a new HttpRequestMethodNotSupportedException.HttpRequestMethodNotSupportedException(String method, String[] supportedMethods, String msg) Create a new HttpRequestMethodNotSupportedException.HttpRequestMethodNotSupportedException(String method, Collection<String> supportedMethods) Create a new HttpRequestMethodNotSupportedException.
- 
Method SummaryModifier and TypeMethodDescriptionReturn the HTTP request method that caused the failure.Return the actually supported HTTP methods asHttpMethodinstances, ornullif not known.String[]Return the actually supported HTTP methods, ornullif not known.Methods inherited from class jakarta.servlet.ServletExceptiongetRootCauseMethods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
HttpRequestMethodNotSupportedExceptionCreate a new HttpRequestMethodNotSupportedException.- Parameters:
- method- the unsupported HTTP request method
 
- 
HttpRequestMethodNotSupportedExceptionCreate a new HttpRequestMethodNotSupportedException.- Parameters:
- method- the unsupported HTTP request method
- msg- the detail message
 
- 
HttpRequestMethodNotSupportedExceptionpublic HttpRequestMethodNotSupportedException(String method, @Nullable Collection<String> supportedMethods) Create a new HttpRequestMethodNotSupportedException.- Parameters:
- method- the unsupported HTTP request method
- supportedMethods- the actually supported HTTP methods (may be- null)
 
- 
HttpRequestMethodNotSupportedExceptionCreate a new HttpRequestMethodNotSupportedException.- Parameters:
- method- the unsupported HTTP request method
- supportedMethods- the actually supported HTTP methods (may be- null)
 
- 
HttpRequestMethodNotSupportedExceptionpublic HttpRequestMethodNotSupportedException(String method, @Nullable String[] supportedMethods, String msg) Create a new HttpRequestMethodNotSupportedException.- Parameters:
- method- the unsupported HTTP request method
- supportedMethods- the actually supported HTTP methods
- msg- the detail message
 
 
- 
- 
Method Details- 
getMethodReturn the HTTP request method that caused the failure.
- 
getSupportedMethodsReturn the actually supported HTTP methods, ornullif not known.
- 
getSupportedHttpMethodsReturn the actually supported HTTP methods asHttpMethodinstances, ornullif not known.- Since:
- 3.2
 
 
-