Class HttpRequestMethodNotSupportedException

java.lang.Object
java.lang.Throwable
java.lang.Exception
jakarta.servlet.ServletException
org.springframework.web.HttpRequestMethodNotSupportedException
All Implemented Interfaces:
Serializable, ErrorResponse

public class HttpRequestMethodNotSupportedException extends ServletException implements ErrorResponse
Exception thrown when a request handler does not support a specific request method.
Since:
2.0
Author:
Juergen Hoeller
See Also:
  • Constructor Details

    • HttpRequestMethodNotSupportedException

      public HttpRequestMethodNotSupportedException(String method)
      Create a new HttpRequestMethodNotSupportedException.
      Parameters:
      method - the unsupported HTTP request method
    • HttpRequestMethodNotSupportedException

      @Deprecated(since="6.0", forRemoval=true) public HttpRequestMethodNotSupportedException(String method, String msg)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a new HttpRequestMethodNotSupportedException.
      Parameters:
      method - the unsupported HTTP request method
      msg - the detail message
    • HttpRequestMethodNotSupportedException

      public HttpRequestMethodNotSupportedException(String method, @Nullable Collection<String> supportedMethods)
      Create a new HttpRequestMethodNotSupportedException.
      Parameters:
      method - the unsupported HTTP request method
      supportedMethods - the actually supported HTTP methods (possibly null)
    • HttpRequestMethodNotSupportedException

      @Deprecated(since="6.0", forRemoval=true) public HttpRequestMethodNotSupportedException(String method, @Nullable String[] supportedMethods)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a new HttpRequestMethodNotSupportedException.
      Parameters:
      method - the unsupported HTTP request method
      supportedMethods - the actually supported HTTP methods (possibly null)
    • HttpRequestMethodNotSupportedException

      @Deprecated(since="6.0", forRemoval=true) public HttpRequestMethodNotSupportedException(String method, @Nullable String[] supportedMethods, String msg)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a new HttpRequestMethodNotSupportedException.
      Parameters:
      method - the unsupported HTTP request method
      supportedMethods - the actually supported HTTP methods
      msg - the detail message
  • Method Details