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, Sam Brannen
See Also:
  • Constructor Details

    • HttpRequestMethodNotSupportedException

      public HttpRequestMethodNotSupportedException(String method)
      Create a new HttpRequestMethodNotSupportedException.
      Parameters:
      method - the unsupported HTTP request method
    • 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)
  • Method Details