Annotation Type RequestMapping


@Retention(CLASS) @Target({TYPE,METHOD}) public @interface RequestMapping

A path, and optionally a verb, for a controller or one of its methods.

On a class it prefixes every mapping inside it. On a method it is the general form of the verb-specific annotations beside it, for verbs they do not cover.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The HTTP verb, when this is used on a method directly.
    The path, or paths, this mapping answers on.
  • Element Details

    • value

      String[] value
      The path, or paths, this mapping answers on.
      Default:
      {}
    • method

      String method
      The HTTP verb, when this is used on a method directly.
      Default:
      ""