org.springframework.web.server

Class MethodNotAllowedException

  • All Implemented Interfaces:
    java.io.Serializable


    public class MethodNotAllowedException
    extends ResponseStatusException
    Exception for errors that fit response status 405 (method not allowed).
    Since:
    5.0
    Author:
    Rossen Stoyanchev
    See Also:
    Serialized Form
    • Constructor Detail

      • MethodNotAllowedException

        public MethodNotAllowedException(HttpMethod method,
                                         java.util.Collection<HttpMethod> supportedMethods)
      • MethodNotAllowedException

        public MethodNotAllowedException(java.lang.String method,
                                         @Nullable
                                         java.util.Collection<HttpMethod> supportedMethods)
    • Method Detail

      • getHttpMethod

        public java.lang.String getHttpMethod()
        Return the HTTP method for the failed request.
      • getSupportedMethods

        public java.util.Set<HttpMethod> getSupportedMethods()
        Return the list of supported HTTP methods.