Annotation Type 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 ElementsModifier and TypeOptional ElementDescriptionString[]Media types the route takes, matched against the request'sContent-Type; a request outside them is answered 415.The HTTP verb, when this is used on a method directly.String[]Media types the route answers with, matched against the request'sAccept; a request that accepts none of them is answered 406.String[]The path, or paths, this mapping answers on.
-
Element Details
-
value
-
method
-
consumes
String[] consumesMedia types the route takes, matched against the request'sContent-Type; a request outside them is answered 415. Empty takes any. On a class it applies to every route that names none of its own.- Default:
{}
-
produces
String[] producesMedia types the route answers with, matched against the request'sAccept; a request that accepts none of them is answered 406. Empty answers anything. The handler still sets the type of what it returns. On a class it applies to every route that names none of its own.- Default:
{}
-