パッケージ org.springframework.web

クラス HttpRequestMethodNotSupportedException

java.lang.ObjectSE
java.lang.ThrowableSE
java.lang.ExceptionSE
jakarta.servlet.ServletException
org.springframework.web.HttpRequestMethodNotSupportedException
実装されたすべてのインターフェース:
SerializableSEErrorResponse

public class HttpRequestMethodNotSupportedException extends ServletExceptionEE implements ErrorResponse
リクエストハンドラーが特定のリクエストメソッドをサポートしていない場合にスローされる例外。
導入:
2.0
作成者:
Juergen Hoeller
関連事項:
  • コンストラクターの詳細

    • HttpRequestMethodNotSupportedException

      public HttpRequestMethodNotSupportedException(StringSE method)
      新しい HttpRequestMethodNotSupportedException を作成します。
      パラメーター:
      method - サポートされていない HTTP リクエストメソッド
    • HttpRequestMethodNotSupportedException

      @DeprecatedSE(since="6.0", forRemoval=true) public HttpRequestMethodNotSupportedException(StringSE method, StringSE msg)
      非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。
      新しい HttpRequestMethodNotSupportedException を作成します。
      パラメーター:
      method - サポートされていない HTTP リクエストメソッド
      msg - 詳細メッセージ
    • HttpRequestMethodNotSupportedException

      public HttpRequestMethodNotSupportedException(StringSE method, @Nullable CollectionSE<StringSE> supportedMethods)
      新しい HttpRequestMethodNotSupportedException を作成します。
      パラメーター:
      method - サポートされていない HTTP リクエストメソッド
      supportedMethods - 実際にサポートされている HTTP メソッド (おそらく null)
    • HttpRequestMethodNotSupportedException

      @DeprecatedSE(since="6.0", forRemoval=true) public HttpRequestMethodNotSupportedException(StringSE method, @Nullable StringSE[] supportedMethods)
      非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。
      新しい HttpRequestMethodNotSupportedException を作成します。
      パラメーター:
      method - サポートされていない HTTP リクエストメソッド
      supportedMethods - 実際にサポートされている HTTP メソッド (おそらく null)
    • HttpRequestMethodNotSupportedException

      @DeprecatedSE(since="6.0", forRemoval=true) public HttpRequestMethodNotSupportedException(StringSE method, @Nullable StringSE[] supportedMethods, StringSE msg)
      非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。
      新しい HttpRequestMethodNotSupportedException を作成します。
      パラメーター:
      method - サポートされていない HTTP リクエストメソッド
      supportedMethods - 実際にサポートされている HTTP メソッド
      msg - 詳細メッセージ
  • メソッドの詳細

    • getMethod

      public StringSE getMethod()
      失敗の原因となった HTTP リクエストメソッドを返します。
    • getSupportedMethods

      @Nullable public StringSE[] getSupportedMethods()
      実際にサポートされている HTTP メソッド、または不明な場合は null を返します。
    • getSupportedHttpMethods

      @Nullable public SetSE<HttpMethod> getSupportedHttpMethods()
      実際にサポートされている HTTP メソッドを HttpMethod インスタンス、または不明の場合は null として返します。
      導入:
      3.2
    • getStatusCode

      public HttpStatusCode getStatusCode()
      インターフェースからコピーされた説明: ErrorResponse
      レスポンスに使用する HTTP ステータスコードを返します。
      次で指定:
      インターフェース ErrorResponsegetStatusCode 
    • getHeaders

      public HttpHeaders getHeaders()
      インターフェースからコピーされた説明: ErrorResponse
      レスポンスに使用するヘッダーを返します。
      次で指定:
      インターフェース ErrorResponsegetHeaders 
    • getBody

      public ProblemDetail getBody()
      インターフェースからコピーされた説明: ErrorResponse
      レスポンスの本文を返します。RFC 7807 ProblemDetail としてフォーマットされ、status はレスポンスステータスと一致する必要があります。
      次で指定:
      インターフェース ErrorResponsegetBody 
    • getDetailMessageArguments

      public ObjectSE[] getDetailMessageArguments()
      インターフェースからコピーされた説明: ErrorResponse
      MessageSource を介してこの例外の問題の「詳細」を解決するために message code と共に使用する引数を返します。引数は、メッセージ値のプレースホルダーに展開されます。「無効なコンテンツ型 {0}」です。
      次で指定:
      インターフェース ErrorResponsegetDetailMessageArguments