列挙型クラス RequestMethod

java.lang.ObjectSE
java.lang.EnumSE<RequestMethod>
org.springframework.web.bind.annotation.RequestMethod
実装されたすべてのインターフェース:
SerializableSEComparableSE<RequestMethod>ConstableSE

public enum RequestMethod extends EnumSE<RequestMethod>
HTTP リクエストメソッドの列挙。RequestMapping アノテーションの RequestMapping.method() 属性で使用することを目的としています。

デフォルトでは、DispatcherServlet は GET、HEAD、POST、PUT、PATCH、DELETE のみをサポートしていることに注意してください。DispatcherServlet は、デフォルトの HttpServlet 動作で TRACE および OPTIONS を処理します。ただし、これらのリクエスト型もディスパッチするように明示的に指示されている場合を除きます。"dispatchOptionsRequest" および "dispatchTraceRequest" プロパティを確認し、必要に応じて "true" に切り替えます。

導入:
2.5
作成者:
Juergen Hoeller
関連事項:
  • 列挙型定数の詳細

  • メソッドの詳細

    • values

      public static RequestMethod[] values()
      この列挙型クラスの定数を含む配列を、宣言されている順序で返します。
      戻り値:
      この列挙型クラスの定数を宣言された順序で含む配列
    • valueOf

      public static RequestMethod valueOf(StringSE name)
      指定された名前でこのクラスの列挙型定数を返します。文字列は、このクラスで列挙型定数を宣言するために使用される識別子と正確に一致する必要があります。(余分な空白文字は許可されません。)
      パラメーター:
      name - 返される列挙定数の名前。
      戻り値:
      指定された名前の列挙定数
      例外:
      IllegalArgumentExceptionSE - この列挙型クラスに指定された名前の定数がない場合
      NullPointerExceptionSE - 引数が null の場合
    • resolve

      @Nullable public static RequestMethod resolve(StringSE method)
      指定されたメソッド値を RequestMethod 列挙値に解決します。method に対応する値がない場合は、null を返します。
      パラメーター:
      method - 文字列としてのメソッド値
      戻り値:
      対応する RequestMethod、または見つからない場合は null 
      導入:
      6.0.6
    • resolve

      @Nullable public static RequestMethod resolve(HttpMethod httpMethod)
      指定された HttpMethod を RequestMethod 列挙値に解決します。httpMethod に対応する値がない場合は、null を返します。
      パラメーター:
      httpMethod - http メソッドオブジェクト
      戻り値:
      対応する RequestMethod、または見つからない場合は null 
      導入:
      6.0.6
    • asHttpMethod

      public HttpMethod asHttpMethod()
      この RequestMethod に対応する HttpMethod を返します。
      戻り値:
      このリクエストメソッドの http メソッド
      導入:
      6.0.6