org.springframework.web

Class HttpRequestMethodNotSupportedException

  • java.lang.Object
  • All Implemented Interfaces:
    java.io.Serializable


    public class HttpRequestMethodNotSupportedException
    extends ServletException
    Exception thrown when a request handler does not support a specific request method.
    Since:
    2.0
    Author:
    Juergen Hoeller
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getMethod()
      Return the HTTP request method that caused the failure.
      java.util.Set<HttpMethod> getSupportedHttpMethods()
      Return the actually supported HTTP methods as HttpMethod instances, or null if not known.
      java.lang.String[] getSupportedMethods()
      Return the actually supported HTTP methods, or null if not known.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HttpRequestMethodNotSupportedException

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

        public HttpRequestMethodNotSupportedException(java.lang.String method,
                                                      java.lang.String msg)
        Create a new HttpRequestMethodNotSupportedException.
        Parameters:
        method - the unsupported HTTP request method
        msg - the detail message
      • HttpRequestMethodNotSupportedException

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

        public HttpRequestMethodNotSupportedException(java.lang.String method,
                                                      @Nullable
                                                      java.lang.String[] supportedMethods)
        Create a new HttpRequestMethodNotSupportedException.
        Parameters:
        method - the unsupported HTTP request method
        supportedMethods - the actually supported HTTP methods (may be null)
      • HttpRequestMethodNotSupportedException

        public HttpRequestMethodNotSupportedException(java.lang.String method,
                                                      @Nullable
                                                      java.lang.String[] supportedMethods,
                                                      java.lang.String msg)
        Create a new HttpRequestMethodNotSupportedException.
        Parameters:
        method - the unsupported HTTP request method
        supportedMethods - the actually supported HTTP methods
        msg - the detail message
    • Method Detail

      • getMethod

        public java.lang.String getMethod()
        Return the HTTP request method that caused the failure.
      • getSupportedMethods

        @Nullable
        public java.lang.String[] getSupportedMethods()
        Return the actually supported HTTP methods, or null if not known.
      • getSupportedHttpMethods

        @Nullable
        public java.util.Set<HttpMethod> getSupportedHttpMethods()
        Return the actually supported HTTP methods as HttpMethod instances, or null if not known.
        Since:
        3.2